MqDockerUp icon indicating copy to clipboard operation
MqDockerUp copied to clipboard

SyntaxError: Unexpected end of JSON input

Open Jejebond opened this issue 2 years ago • 4 comments

Hello ! My MqDockerUp keeps rebooting.

17.09.2023 08:51:20 [error] MqDockerUp stopped due to an error 17.09.2023 08:51:20 [error] object 17.09.2023 08:51:20 [error] SyntaxError: Unexpected end of JSON input at JSON.parse () at IncomingMessage. (/app/src/services/DockerService.ts:23:28) at IncomingMessage.emit (node:events:514:28) at IncomingMessage.emit (node:domain:489:12) at addChunk (node:internal/streams/readable:324:12) at readableAddChunk (node:internal/streams/readable:297:9) at IncomingMessage.Readable.push (node:internal/streams/readable:234:10) at HTTPParser.parserOnBody (node:_http_common:131:24) at Socket.socketOnData (node:_http_client:541:22) at Socket.emit (node:events:514:28)

Jejebond avatar Sep 17 '23 08:09 Jejebond

The problem you are getting seems to be happening here: https://github.com/MichelFR/MqDockerUp/blob/11bb787160d15c2aad1d80c8cebf3c15447df193/src/services/DockerService.ts#L23

That’s strange, your MqDockerUp is getting changed from the docker sock. But it cannot parse it’s data. im gonna surround this part of the code with a try/fetch so that it wouldn’t stop the entire process. But this should be further inspection.

Im gonna come back to you when I got some news/ a new build

MichelFR avatar Sep 17 '23 14:09 MichelFR

Hello, same issue here:

`19.01.2024 22:46:01 [error] MqDockerUp stopped due to an error 19.01.2024 22:46:01 [error] object 19.01.2024 22:46:02 [error] SyntaxError: Unexpected end of JSON input at JSON.parse () at IncomingMessage. (/app/src/services/DockerService.ts:23:28) at IncomingMessage.emit (node:events:517:28) at IncomingMessage.emit (node:domain:489:12) at addChunk (node:internal/streams/readable:335:12) at readableAddChunk (node:internal/streams/readable:308:9) at IncomingMessage.Readable.push (node:internal/streams/readable:245:10) at HTTPParser.parserOnBody (node:_http_common:131:24) at Socket.socketOnData (node:_http_client:541:22) at Socket.emit (node:events:517:28)

[email protected] start`

pvh0 avatar Jan 19 '24 22:01 pvh0

Hello, I've the same issue here. It's working well on a Synology DSM 7 docker. All the informations are well available in HA.

But the MqDockerUp docker is rebooting every 5min. Any updates on this bug ?

Thanks

smoreau59 avatar Mar 08 '24 16:03 smoreau59

I suspect that the error I get at startup is a similar symptom on the same issue:

mqdockerup  | 19.04.2025 22:07:53 [info] Connected to the database.
mqdockerup  | 19.04.2025 22:07:53 [info] MQTT client successfully connected
mqdockerup  | 19.04.2025 22:07:53 [info] Checking for removed containers...
mqdockerup  | 19.04.2025 22:07:53 [info] Database initialized successfully
mqdockerup  | 19.04.2025 22:07:53 [info] Checking for containers...
mqdockerup  | 19.04.2025 22:07:53 [info] Finished checking for containers
mqdockerup  | 19.04.2025 22:07:53 [info] Next check in 5 minutes
mqdockerup  | 19.04.2025 22:07:53 [verbose] Setting up startContainerCheckingInterval with value 5m
mqdockerup  | 19.04.2025 22:07:53 [info] Checking for image updates...
mqdockerup  | 19.04.2025 22:07:53 [info] Shutting down MqDockerUp...
mqdockerup  | 19.04.2025 22:07:53 [info] Closing MQTT connection...
mqdockerup  | 19.04.2025 22:07:53 [info] MQTT connection closed successfully
mqdockerup  | 19.04.2025 22:07:53 [error] MqDockerUp stopped due to an error
mqdockerup  | 19.04.2025 22:07:53 [error] object
mqdockerup  | 19.04.2025 22:07:53 [error] SyntaxError: Unexpected token { in JSON at position 2839
mqdockerup  |     at JSON.parse (<anonymous>)
mqdockerup  |     at IncomingMessage.<anonymous> (/app/src/services/DockerService.ts:41:28)
mqdockerup  |     at IncomingMessage.emit (node:events:517:28)
mqdockerup  |     at IncomingMessage.emit (node:domain:489:12)
mqdockerup  |     at addChunk (node:internal/streams/readable:368:12)
mqdockerup  |     at readableAddChunk (node:internal/streams/readable:341:9)
mqdockerup  |     at IncomingMessage.Readable.push (node:internal/streams/readable:278:10)
mqdockerup  |     at HTTPParser.parserOnBody (node:_http_common:131:24)
mqdockerup  |     at Socket.socketOnData (node:_http_client:541:22)
mqdockerup  |     at Socket.emit (node:events:517:28)

IngmarStein avatar Apr 19 '25 22:04 IngmarStein