Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker image shutting down after a few days #16

Closed
Mange opened this issue Jul 27, 2019 · 11 comments
Closed

Docker image shutting down after a few days #16

Mange opened this issue Jul 27, 2019 · 11 comments

Comments

@Mange
Copy link

Mange commented Jul 27, 2019

I'm running the service inside the official docker image and proxy it via nginx + let's encrypt. After a few days the process exits with status code 0 and no log output, making nginx shut down (for domain name reasons with docker-compose; but that's not the issue here).

Is there some way I can try to debug this problem? I'm pretty confident in Rust, but it's also running on a server with limited hardware, so recompiling constantly is probably not going to work for me.

It's happened four times now, so I'm now turning on restart: unless-stopped to work around it, but getting to the cause of the issue would be preferred by me.

The little information I can give:

  1. Process had no output. Exit status 0.
  2. The most I've been able to have the container running at a time: Around 3 days.
  3. Service works well when it's running (although it emits a lot of warnings about upgrading websockets.
  4. Memory pressure on the server is fine. It was not killed by OOM killer according to docker inspect either.
  5. CPU usage has been low up until the service died.
  6. No problem with disk space.
  7. Server has had no network interruptions during this time.
  8. No other container (I run around 11 of them) has any similar issues.
  9. Server is my own hardware at home, not a cloud host or a VM. No hardware issues that I know of, and it's pretty new.

I'm sorry I cannot give any more information. This "issue" is literally me asking for ideas on what to look for so I can give you better information.

@izderadicka
Copy link
Owner

Are you using provided Dockerfile for alpine linux?
What exact config/ rguments are you using to run program?

To get more detailed logging (debug) you'll need to compile in debug mode (without --release, binary then will be in target/debug) and set environment variable to RUST_LOG=debug (which will log debug from all creates) or just RUST_LOG=audioserve=debug - to log only debug messages from this binary.

You can also try to strip down features you are not using - compile with --no-default-features and then --features you want. This will leave out unwanted code in case it causes problems.

When exactly the termination of container happens?

  • when streaming some music?
  • when working with files in collections directories (copying new, renaming etc)?
  • or when audioserve is unused?

As exist status is 0 I assume it's not segfault or some other OS enforced termination.

@izderadicka
Copy link
Owner

Also looking now at default logging when running in Docker container it was not ideal - although info logging is enabled for release build, it's not enabled by adding appropriate env. variable (I've fixed it in latest master).
So at least I would recommend to have ENV RUST_LOG=audioserve=info in docker file, then you can see if program terminated normally - as this message should be last one:

INFO  audioserve > Server finished

@Mange
Copy link
Author

Mange commented Aug 1, 2019

I run it using this docker-compose configuration:

    audioserve:
      image: izderadicka/audioserve
      container_name: audioserve
      command: ["--allow-symlinks", "/audiobooks"]
      volumes:
        - /home/mange/services/audioserve/config:/home/audioserve/.audioserve
        - /home/mange/services/audioserve/library:/audiobooks
      env_file:
        - /home/mange/services/audioserve/config/secrets.env
      restart: unless-stopped

It happens when the service is not used.

I'll see about recompiling it and trying the debug logs for a bit, but now it's been running without issue for 4 days. I'll recompile it the next time it crashes, just before I also capture the whole output of docker inspect so I had additional clues.

@izderadicka
Copy link
Owner

@Mange Any more crashes? Some logs?

@Mange
Copy link
Author

Mange commented Aug 27, 2019

Seems from docker inspect that the current container was started on the 8th of august, a week after my last update. But since then it's been running (Up 2 weeks).

Log is just full of

 ERROR websock > Upgrade is not to websocket
 ERROR websock > It must be upgrade connection

so I can't give you anything from there.

@izderadicka
Copy link
Owner

Thanks,
the error messages are related to the playback position sharing, which is kind of experimental now (position is sent over websocket as file is playing). If you are not using it you can disable it in client by not specifying group.

@Mange
Copy link
Author

Mange commented Aug 28, 2019

I am actually trying to use it, though. 😄

@izderadicka
Copy link
Owner

@Mange And is it working? Can you open another issue for these error messages? I'm also trying to use it , but getting different messages

ERROR websock                                       > Socket error Ws

I think I know why this message come from - it's when websocket is closed unexpentantly (mobile device lost connection, rev. proxy closes connection). Here it looks like client is using incorrect websocket request - or maybe it's proxy (normally you need to do some setup on rev. proxy for websockets to work).

@izderadicka
Copy link
Owner

Any update? Still problem with docker image stability?

@Mange
Copy link
Author

Mange commented Dec 29, 2019 via email

@izderadicka
Copy link
Owner

@Mange Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants