Hi team, i was getting docker container error logs as
Error grabbing logs: invalid character 'l' after object key:value pair
How to resolve that.
Share and learn in the Docker community.
Hi team, i was getting docker container error logs as
Error grabbing logs: invalid character 'l' after object key:value pair
How to resolve that.
What makes you think that single line of error message without any context, any shared command without knowing how it is related to Docker will help us to understand your issue? Just because something is running in a container it doesnāt mean the error message is caused by Docker. If you feel it is, you need to share more details.
Show how you started the container (command, compose file) and how you retrieve the logs.
@rimelek Thanks for the reply, I troubleshooted that container log files were corrupted. and increased log opt max size.
I am not sure that will help. I would expect that Traefik by default can handle the log files very well, independent of the max size set. So itās probably another issue leading to your problem. Disk full, corrupt file system, etc.
Instead of setting it larger, I would rather set it smaller and also set the number of maximum files kept.
Could be a bug. Here is another issue with the same error message:
I have the same problem. When you try to request logs using the docker logs -f 3ac1d119c1f7
or docker compose logs -f app
command, a log and an error are displayed: āError grabbing logs: invalid character ālā after object key:value pairā. This happens when the container is automatically launched if you turn off the machine and turn it back on. If you stop the container and start it again, everything works fine.
Docker version 26.1.4, build 5650f9b
Docker Compose version v2.27.1
docker compose
services:
app:
build:
context: ./app
target: $NODE_ENV
env_file: ./.env
environment:
- APP_NAME=app
expose:
- $APP_PORT
volumes:
- ./app:/usr/src/app
- ./app/logs:/usr/src/app/logs
restart: always
tty: true
In my case this occured when the vm had no available disk space. So you should ensure that this is not the case.