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

no response from backend #27

Closed
danielk117 opened this issue Dec 10, 2020 · 12 comments
Closed

no response from backend #27

danielk117 opened this issue Dec 10, 2020 · 12 comments
Labels
bug Something isn't working

Comments

@danielk117
Copy link

Hi,

I've got a problem, installing librephotos on my NAS. It's a Synology with an Atom.
I installed it using your compose-file. All containers are running. I just need to add the proxy to my brdige network and i was able to connect to the frontend over port 3000.

CONTAINER ID        IMAGE                                      COMMAND                  CREATED             STATUS                PORTS                  NAMES
10f9de80d73b        reallibrephotos/librephotos-proxy:dev      "/docker-entrypoint.…"   12 minutes ago      Up 12 minutes         0.0.0.0:3000->80/tcp   librephotos-proxy
5ed6c2be6935        reallibrephotos/librephotos-frontend:dev   "/bin/sh -c ./run.sh…"   12 minutes ago      Up 12 minutes         3000/tcp               librephotos-frontend
0c9743f502b2        reallibrephotos/librephotos:dev            "/bin/sh -c ./entryp…"   13 minutes ago      Up 13 minutes         80/tcp                 librephotos-backend
6fdf7bc647a6        postgres                                   "docker-entrypoint.s…"   15 minutes ago      Up 15 minutes         5432/tcp               librephotos-db
9a049db72a7b        redis                                      "docker-entrypoint.s…"   15 minutes ago      Up 15 minutes         6379/tcp               librephotos-redis

When I try to login, i've got the following error message. The browser never receives a response for the call to *:3000/api/auth/token/obtain/.

grafik

I checked the log of the backend container and got the following:

 * Restarting nginx nginx
   ...done.
./entrypoint.sh: line 29:    52 Illegal instruction     (core dumped) /miniconda/bin/python manage.py shell <<EOF
from api.models import User

if User.objects.filter(username="$ADMIN_USERNAME").exists():
    admin_user = User.objects.get(username="$ADMIN_USERNAME")
    admin_user.set_password("$ADMIN_PASSWORD")
    admin_user.save()
else:
    User.objects.create_superuser('$ADMIN_USERNAME', '$ADMIN_EMAIL', '$ADMIN_PASSWORD')
EOF

Running backend server...
[2020-12-10 08:23:25 +0000] [56] [INFO] Starting gunicorn 20.0.4
[2020-12-10 08:23:25 +0000] [56] [INFO] Listening at: http://0.0.0.0:8001 (56)
[2020-12-10 08:23:25 +0000] [56] [INFO] Using worker: gevent
[2020-12-10 08:23:25 +0000] [60] [INFO] Booting worker with pid: 60
[2020-12-10 08:23:25 +0000] [61] [INFO] Booting worker with pid: 61
[2020-12-10 08:23:27 +0000] [62] [INFO] Booting worker with pid: 62
[2020-12-10 08:23:28 +0000] [63] [INFO] Booting worker with pid: 63
[2020-12-10 08:23:30 +0000] [64] [INFO] Booting worker with pid: 64
[2020-12-10 08:23:30 +0000] [65] [INFO] Booting worker with pid: 65
[2020-12-10 08:23:32 +0000] [66] [INFO] Booting worker with pid: 66
[2020-12-10 08:23:32 +0000] [67] [INFO] Booting worker with pid: 67
[2020-12-10 08:23:34 +0000] [68] [INFO] Booting worker with pid: 68
[2020-12-10 08:23:34 +0000] [69] [INFO] Booting worker with pid: 69
[2020-12-10 08:23:37 +0000] [70] [INFO] Booting worker with pid: 70
[2020-12-10 08:23:37 +0000] [71] [INFO] Booting worker with pid: 71
[2020-12-10 08:23:39 +0000] [72] [INFO] Booting worker with pid: 72
[2020-12-10 08:23:39 +0000] [73] [INFO] Booting worker with pid: 73

Any idea whats going wrong?

BTW: Thanks for reviving the project!!! 😃

@danielk117 danielk117 changed the title no answer from backend no response from backend Dec 10, 2020
@derneuere
Copy link
Member

It looks like the backend server can't connect to the db, because it can't execute the command in the entrypoint.sh to create the admin user. Maybe it is a linking issue within the Synology Os? I would try updating the Synology docker add-on and trying it again. Do you use other services that are linked with docker-compose?

No Problem! :D

@derneuere derneuere added the question Further information is requested label Dec 10, 2020
@danielk117
Copy link
Author

just checked db and redis

admin@NAS:~$ sudo docker logs librephotos-db
PostgreSQL Database directory appears to contain a database; Skipping initialization

2020-12-10 08:20:38.517 UTC [1] LOG:  starting PostgreSQL 13.1 (Debian 13.1-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
2020-12-10 08:20:38.519 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2020-12-10 08:20:38.519 UTC [1] LOG:  listening on IPv6 address "::", port 5432
2020-12-10 08:20:38.636 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2020-12-10 08:20:38.643 UTC [25] LOG:  database system was shut down at 2020-12-10 08:20:36 UTC
2020-12-10 08:20:38.654 UTC [1] LOG:  database system is ready to accept connections

admin@NAS:~$ sudo docker logs librephotos-redis
1:C 10 Dec 2020 08:20:37.796 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 10 Dec 2020 08:20:37.797 # Redis version=6.0.9, bits=64, commit=00000000, modified=0, pid=1, just started
1:C 10 Dec 2020 08:20:37.797 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
1:M 10 Dec 2020 08:20:37.799 * Running mode=standalone, port=6379.
1:M 10 Dec 2020 08:20:37.799 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
1:M 10 Dec 2020 08:20:37.799 # Server initialized
1:M 10 Dec 2020 08:20:37.799 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
1:M 10 Dec 2020 08:20:37.800 * Loading RDB produced by version 6.0.9
1:M 10 Dec 2020 08:20:37.800 * RDB age 3 seconds
1:M 10 Dec 2020 08:20:37.800 * RDB memory usage when created 0.77 Mb
1:M 10 Dec 2020 08:20:37.800 * DB loaded from disk: 0.000 seconds
1:M 10 Dec 2020 08:20:37.800 * Ready to accept connections

seems to work fine.

docker and compose are the "latest" versions from synology. but they are old...

admin@NAS:~$ sudo docker -v
Docker version 18.09.8, build bfed4f5
admin@NAS:~$ sudo docker-compose -v
docker-compose version 1.24.0, build 0aa59064

I was able to manual update the binaries to the real latest ones. I will give a try later.

@derneuere
Copy link
Member

Okay it seems to be an old issue: hooram/ownphotos#10
Will push an update soon. It is wrong in the dockerfile.

@derneuere derneuere added bug Something isn't working and removed question Further information is requested labels Dec 10, 2020
derneuere added a commit that referenced this issue Dec 10, 2020
@derneuere
Copy link
Member

I created a new image. Please do a docker-compose pull and then a docker-compose up. It should work now. If it does close the issue :)

@danielk117
Copy link
Author

danielk117 commented Dec 10, 2020

Seems to work. I was able to login and browse through the frontend. 👍
But the Backend does not scan photos. My volumes are

      - /volume3/docker/librephotos/photos:/data
      - /volume3/docker/librephotos/media:/code/protected_media
      - /volume3/docker/librephotos/logs:/code/logs

I put some photos to the photos folder und click on:
grafik
backend-log show on click:
127.0.0.1 - - [2020-12-10 20:58:51] "POST /build/ HTTP/1.1" 200 139 0.001794
I checked the permissions. The Backend is allowed to access his /data folder and change the files inside it.

@derneuere
Copy link
Member

You need to log in as the demo user and set up the directory for the demo user. To do this, click the top right button, and go to "Admin Area". On this page, it will show a list of users. Set the "Scan Directory" for the demo user by clicking the editing button:
image
After that you can go to Dashboard - Library and click the green "Scan photos (file system)" button.

@danielk117
Copy link
Author

now it works!
sorry for my mistake. i thought i had scanned the entire interface for settings. 😄

@danielk117
Copy link
Author

do you need some help with docs?
like "how to add a folder to scan to"? 😄
or how to install librephotos on a Synology NAS?

@derneuere
Copy link
Member

Yes that would be great! Open a pull request or write me on discord if you have some docs :)

@edsonsbj
Copy link

edsonsbj commented May 4, 2022

First I don't know if this question has been closed, however yesterday when installing librephotos docker it presented the same error. No connection to backend server, try again in a few minutes.

@derneuere
Copy link
Member

You probably missed the step renaming librephotos.env to .env

@edsonsbj
Copy link

edsonsbj commented May 5, 2022

Você provavelmente perdeu a etapa de renomeação de librephotos.env para .env

I ran the process of copying librephotos.env to .env and changed the folder variables and nothing. I don't know where I saw that the user is admin and the password is admin and that it could be changed in the .env but in the env there is nothing mentioning the user and password of the interface

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants