Skip to content

Exception was Failed to post to /login/login.json returned Unauthorized #83

Description

@marshallmassengill

This has been working flawlessly for a while now but it looks like maybe something has changed with Enphase again and they not authenticating it to grab the token. Willing to debug further but I'm not sure where to start for that. I have double checked that the password I'm giving it is good and it will let me login to the https://enlighten.enphaseenergy.com/login/login.json site with it.

2025-11-08T16:28:18.121Z ERROR 1943 --- [EnphaseCollector] [   scheduling-2] com.hz.services.EnvoyService             : Failed to retrieve Solar stats. Exception was Failed to post to /login/login.json returned Unauthorized

java.io.IOException: Failed to post to /login/login.json returned Unauthorized
	at com.hz.utils.EnphaseJWTExtractor.lambda$sendRequest$0(EnphaseJWTExtractor.java:52) ~[!/:development-SNAPSHOT]
	at org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(CloseableHttpClient.java:247) ~[httpclient5-5.2.3.jar!/:5.2.3]
	at org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(CloseableHttpClient.java:188) ~[httpclient5-5.2.3.jar!/:5.2.3]
	at org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(CloseableHttpClient.java:162) ~[httpclient5-5.2.3.jar!/:5.2.3]
	at com.hz.utils.EnphaseJWTExtractor.sendRequest(EnphaseJWTExtractor.java:50) ~[!/:development-SNAPSHOT]
	at com.hz.utils.EnphaseJWTExtractor.postLogin(EnphaseJWTExtractor.java:69) ~[!/:development-SNAPSHOT]
	at com.hz.utils.EnphaseJWTExtractor.fetchJWT(EnphaseJWTExtractor.java:85) ~[!/:development-SNAPSHOT]
	at com.hz.services.EnvoyConnectionProxy.getSecureTemplate(EnvoyConnectionProxy.java:133) ~[!/:development-SNAPSHOT]
	at com.hz.services.EnvoyService.getSystemData(EnvoyService.java:47) ~[!/:development-SNAPSHOT]
	at com.hz.services.EnvoyService.collectEnphaseData(EnvoyService.java:58) ~[!/:development-SNAPSHOT]
	at com.hz.services.OutputManager.gather(OutputManager.java:47) ~[!/:development-SNAPSHOT]
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) ~[na:na]
	at java.base/java.lang.reflect.Method.invoke(Method.java:580) ~[na:na]
	at org.springframework.scheduling.support.ScheduledMethodRunnable.runInternal(ScheduledMethodRunnable.java:130) ~[spring-context-6.1.6.jar!/:6.1.6]
	at org.springframework.scheduling.support.ScheduledMethodRunnable.lambda$run$2(ScheduledMethodRunnable.java:124) ~[spring-context-6.1.6.jar!/:6.1.6]
	at io.micrometer.observation.Observation.observe(Observation.java:499) ~[micrometer-observation-1.12.5.jar!/:1.12.5]
	at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:124) ~[spring-context-6.1.6.jar!/:6.1.6]
	at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) ~[spring-context-6.1.6.jar!/:6.1.6]
	at java.base/java.lang.VirtualThread.run(VirtualThread.java:329) ~[na:na]

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions