Giter Club home page Giter Club logo

Comments (14)

jmattheis avatar jmattheis commented on May 24, 2024

Yeah, it is logged to standard out.

from server.

d03j avatar d03j commented on May 24, 2024

Thanks. I get noting after podman gotify.

I'm running 2.4.0, started by:

podman run --replace --name=gotify -d \
  -e TZ=$GLOBAL_TZ \
  --pod $PODNAME \
  --net $NETWORKSTRING \
  -v $GOTIFY_DIR/data:/app/data \
  -p $GOTIFY_PORT:80 \
  docker.io/gotify/server:latest

Am I missing something?

from server.

jmattheis avatar jmattheis commented on May 24, 2024

Probably something like

podman logs gotify

See podman documentation.

from server.

d03j avatar d03j commented on May 24, 2024

sorry, that's what I meant by podman gotify: it was actually podman logs gotify!

Upon further inspection, I just realised podman logs is not returning any output for any of my containers. So the issue seems to be with podman.

from server.

d03j avatar d03j commented on May 24, 2024

sorry. that's no true. some containers don't seem to show anything when I do podman logs, but others do.

$ podman logs whoami
2023/10/26 18:43:39 Starting up on port 80
2023/10/26 18:43:44 Starting up on port 80
2023/10/31 22:45:31 Starting up on port 80

from server.

jmattheis avatar jmattheis commented on May 24, 2024

Works for me.

$ sudo podman run  --name=gotify -d -v ~/src/playground/gotify/data:/app/data -p 80:80 docker.io/gotify/server:latest
c8ff083e03947a4febb146ba456c2662cb1c3a86158b641c46fe1a91660aa46f
$ sudo podman logs gotify
Starting Gotify version 2.4.0@2023-09-17-08:24:00
Started Listening for plain HTTP connection on :80
2023-11-01T13:28:32Z | 200 |     291.416µs |       10.88.0.1 | GET      "/"
2023-11-01T13:28:32Z | 200 |    1.994447ms |       10.88.0.1 | GET      "/static/css/2.0f3898ba.chunk.css"
2023-11-01T13:28:32Z | 200 |    2.719047ms |       10.88.0.1 | GET      "/static/js/main.f445756e.chunk.js"
2023-11-01T13:28:32Z | 200 |   25.122091ms |       10.88.0.1 | GET      "/static/js/2.a296d629.chunk.js"
2023-11-01T13:28:32Z | 401 |     218.017µs |       10.88.0.1 | GET      "/current/user"
Error #01: you need to provide a valid access token or user credentials to access this api
2023-11-01T13:28:32Z | 200 |     118.385µs |       10.88.0.1 | GET      "/static/media/roboto-latin-400.176f8f5b.woff2"
2023-11-01T13:28:32Z | 200 |       77.77µs |       10.88.0.1 | GET      "/static/media/roboto-latin-500.f5b74d7f.woff2"
2023-11-01T13:28:33Z | 200 |       89.05µs |       10.88.0.1 | GET      "/static/favicon-196x196.png"
2023-11-01T13:28:33Z | 200 |      11.282µs |       10.88.0.1 | GET      "/static/favicon-16x16.png"
2023-11-01T13:28:33Z | 401 |     163.158µs |       10.88.0.1 | GET      "/client"
Error #01: you need to provide a valid access token or user credentials to access this api
2023-11-01T13:28:33Z | 401 |     145.957µs |       10.88.0.1 | GET      "/current/user"
Error #01: you need to provide a valid access token or user credentials to access this api
2023-11-01T13:28:33Z | 401 |      20.783µs |       10.88.0.1 | GET      "/client"
Error #01: you need to provide a valid access token or user credentials to access this api

from server.

d03j avatar d03j commented on May 24, 2024

thank you. what podman version are you running? I've tried to run 4.6.2 as root and rootless (the reason I use podman instead of docker in the first place) with no luck.

from server.

jmattheis avatar jmattheis commented on May 24, 2024
$ podman version
Client:       Podman Engine
Version:      4.7.1
API Version:  4.7.1
Go Version:   go1.21.1
Git Commit:   ef83eeb9c7482826672f3efa12db3d61c88df6c4-dirty
Built:        Fri Oct  6 11:12:34 2023
OS/Arch:      linux/amd64

Is the gotify container running podman ps?

from server.

d03j avatar d03j commented on May 24, 2024

yes. I can send messages to it and all. unfortunately I'm running ubuntu 22.04 and have the kubic repo so I can get to podman 4...

$ podman version
Client:       Podman Engine
Version:      4.6.2
API Version:  4.6.2
Go Version:   go1.18.1
Built:        Thu Jan  1 10:00:00 1970
OS/Arch:      linux/amd64

from server.

jmattheis avatar jmattheis commented on May 24, 2024

Could you try run'ning the gotify image with --log-driver json-file? E.g.

podman run  --replace --name=gotify -d -v ~/src/playground/gotify/data:/app/data -p 80:80 --log-driver json-file docker.io/gotify/server:latest

and verify if the log works?

from server.

d03j avatar d03j commented on May 24, 2024

It does! Thank you!

$ podman logs gotify
Starting Gotify version 2.4.0@2023-09-17-08:24:00
Started Listening for plain HTTP connection on :80
2023-11-05T09:02:04+11:00 | 200 |   83.895571ms |   192.168.0.205 | GET      "/"
2023-11-05T09:02:05+11:00 | 200 |  204.585058ms |   192.168.0.205 | GET      "/static/css/2.0f3898ba.chunk.css"
2023-11-05T09:02:05+11:00 | 200 |  203.380579ms |   192.168.0.205 | GET      "/static/js/main.f445756e.chunk.js"
2023-11-05T09:02:05+11:00 | 200 |  382.025282ms |   192.168.0.205 | GET      "/static/js/2.a296d629.chunk.js"
2023-11-05T09:02:06+11:00 | 200 |     523.037µs |   192.168.0.205 | GET      "/static/favicon-196x196.png"
2023-11-05T09:02:06+11:00 | 200 |     140.473µs |   192.168.0.205 | GET      "/static/favicon-16x16.png"

from server.

d03j avatar d03j commented on May 24, 2024

I know this is a podman question, but do you know a way to have the logs written to a file at a specific location?

Executing podman inspect --format='{{.HostConfig.LogConfig.Path}}' gotify gives me a ctr.log file under $HOME/.local/share/containers/storage/overlay-containers//userdata. The problem is my container id will change from time to time and I need it to be on a predictable location.

from server.

jmattheis avatar jmattheis commented on May 24, 2024

To summarize the original problem, podman isn't able to log into the default log-driver (probably journald) this could be because of the rootless execution and missing permissions.

See podman docs for your question: https://docs.podman.io/en/latest/markdown/podman-run.1.html#log-opt-name-value

from server.

d03j avatar d03j commented on May 24, 2024

Thank you! To summarise the solution:

podman run  --replace --name=gotify -d -v ~/path/to/gotify/data/on/host:/app/data -p 80:80 --log-driver json-file --log-opt path=/path/to/gotify.log docker.io/gotify/server:latest

from server.

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.