Giter Club home page Giter Club logo

Comments (7)

sidey79 avatar sidey79 commented on June 17, 2024 1

What do you mean with "only with one single newline"? Are you now able to recreate the issue or not?

I can't reproduce the error, with sudo docker logs <name of container> -f
Bit in the logfile sometimes newlines are added
{"log":"\n","stream":"stdout","time":"2023-09-12T15:06:34.882448783Z"}

And sorry to bring this up again, but: What check is in place so that printf is executed only if there is something in $logArray to be printed?

Currently, none is implemented, i'll fix this

from fhem-docker.

sidey79 avatar sidey79 commented on June 17, 2024

I saw this bug before, but not in this Image version.

Also i am currently not able to reproduce this

from fhem-docker.

passibe15 avatar passibe15 commented on June 17, 2024

Okay, interesting.
I just tested it with a fresh service, i.e. docker-compose.yml:

version: "3.3"
services:
  fhemtest:
    image: ghcr.io/fhem/fhem-docker:3-bullseye
    container_name: fhemtest
    restart: unless-stopped
    environment:
      TZ: Europe/Berlin

and can confirm that the bug (still) exists by running sudo docker logs fhemtest -f.

Edit: The logs command is not even needed. The same happens if you simply run sudo docker compose -f docker-compose.yml up.

from fhem-docker.

sidey79 avatar sidey79 commented on June 17, 2024

Can you check that you are really running container version 3.2.3?

Can you run a inspect, on the started container like this:
docker inspect <containerID>| grep version

from fhem-docker.

passibe15 avatar passibe15 commented on June 17, 2024

Yes, I am running 3.2.3:

                "com.docker.compose.version": "2.21.0",
                "org.fhem.version": "",
                "org.opencontainers.image.version": "3.2.3-bullseye"

Even if I pin the version in the docker-compose.yml to ghcr.io/fhem/fhem-docker:3.2.3-bullseye it's the same. I also just tested it on another system with the compose-file posted above (also Debian bullseye) and the bug is still present.

Just from a logical point of view:
There is no check in place whether $logArray is actually populated. So printf '%s\n' "${logArray[@]}" is executed every time PrintNewLines runs, independent of what $logArray contains (or doesn't contain). There is simply nothing there preventing it from printing \n every time it runs.

On another note: My "fix" from above, moving printf … into the else-branch works flawlessly, even after two nightly logrotates now.

from fhem-docker.

sidey79 avatar sidey79 commented on June 17, 2024

I see a similar problem only with one single newline.
For this i have already prepared a fix in the bookworm branch

from fhem-docker.

passibe15 avatar passibe15 commented on June 17, 2024

What do you mean with "only with one single newline"? Are you now able to recreate the issue or not?

And sorry to bring this up again, but: What check is in place so that printf is executed only if there is something in $logArray to be printed?

from fhem-docker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.