Closed FredrikMeyer closed 3 years ago
Never mind!
I found the (stupid) error. I didn't realize you had to clone the whole repo to start docker-compose
...
I guess you can close the issue. Thanks for the cool project!
Thanks for trying hakatime!
The problem was that postgres wasn't initialized. You don't have to clone the repo, but you do need to apply the sql files in order to create the db schema.
Btw, you shouldn't need privileged: true
to run the container. Could you provide the logs from this error?
Here's the logs without privileged
:
pi@raspberrypi:~/hakatime $ docker-compose -f docker-compose-deploy.yml up
Starting hakatime ... done
Starting haka_db ... done
Attaching to haka_db, hakatime
haka_db |
haka_db | PostgreSQL Database directory appears to contain a database; Skipping initialization
haka_db |
haka_db | 2020-09-22 20:49:04.075 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
haka_db | 2020-09-22 20:49:04.075 UTC [1] LOG: listening on IPv6 address "::", port 5432
haka_db | 2020-09-22 20:49:04.093 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
hakatime | clock_gettime: Operation not permitted
haka_db | 2020-09-22 20:49:04.166 UTC [21] LOG: database system was shut down at 2020-09-22 20:48:58 UTC
haka_db | 2020-09-22 20:49:04.233 UTC [1] LOG: database system is ready to accept connections
hakatime exited with code 1
^CGracefully stopping... (press Ctrl+C again to force)
Stopping haka_db ...
Killing haka_db ... done
^C
I found out about this from this blog post: https://stackoverflow.com/questions/53748644/linux-syscall-clock-settime-fails-with-eperm-in-docker-container
👍 also needed to include privileged: true
to get it to work,
this error else would make the hakatime
container fail:
clock_gettime: Operation not permitted
Thanks for the support on the Pi!
I got the instance up and running, though I can't get the register to work. The SQL instance logs show me everything was created, and yes I have the enable registration flag to true in the docker-compose-deploy.yml
Do you have any errors in hakatime's logs?
hakatime | 192.168.1.59 - - [02/Oct/2020:20:26:34 +0000] "POST /auth/refresh_token HTTP/1.1" 400 - "http://raspberrypi.main:8080/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36" hakatime | 192.168.1.59 - - [02/Oct/2020:20:26:34 +0000] "GET /nunito-latin-400.4a62a00a.woff HTTP/1.1" 400 - "http://raspberrypi.main:8080/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36" hakatime | 192.168.1.59 - - [02/Oct/2020:20:26:34 +0000] "GET /nunito-latin-400.3a5373d7.woff2 HTTP/1.1" 400 - "http://raspberrypi.main:8080/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36" hakatime | 192.168.1.59 - - [02/Oct/2020:20:26:57 +0000] "POST /auth/register HTTP/1.1" 400 - "http://raspberrypi.main:8080/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36"
Seems like a CORS issue, check the server response payload on your browser.
You can fix it by setting the environment variable HAKA_CORS_URL
to your domain. In your case it should be http://raspberrypi.main:8080/
that was it. Oddly enough, i had changed them all before having the raspberry pi build issues. it's up and running now.
@FredrikMeyer @timvoet @christian-fei I was wondering if adding the SYS_TIME
capability when running the container fixes the issue so you don't have to run as privileged. An example would be docker run --cap-add=SYS_TIME ..
or replace privileged: true
in the docker compose file with the following
cap_add:
- SYS_TIME
Closing as resolved. Please re-open if that's not the case.
Hi!
I'm trying the
mujx/hakatime:latest-arm
image, and have some trouble getting hakatime to work.Running
docker-compose -f docker-compose-deploy.yml up
works fine. I had to addprivileged: true
, because I got an error saying that it couldn't read the the time.I also had to change
to
to be able to open the UI on my computer (and not the Pi).
However, I cannot get past the login screen. First, I see
POST http://192.168.0.13:8080/auth/refresh_token 400 (Bad Request)
in the console log in Chrome. And when I try to register a new user, I seein the application logs.
For completeness, this is how my now edited Docker compose file looks like: