immich-app / immich

High performance self-hosted photo and video management solution.
https://immich.app
GNU Affero General Public License v3.0
46.39k stars 2.3k forks source link

[BUG] Admin Registration Sign Up does not work, nothing happens #2499

Closed megapearl closed 1 year ago

megapearl commented 1 year ago

The bug

Hi,

First off thanks for your great work, I switched from photoprism to immich since you got face recognition working.

I use portainer stacks, and set up Immich using the docker-compose file, using an already existing postgres and redis database and reverse proxy nginx (swag).

All dockers are running and are not giving any errors, when I browse to Immich for the first time I got the welcome image with 'Getting Started' button which I clicked, after that I got below image.

image

When I press the signup button nothing happens and no errors are logged in any of the dockers.

How to troubleshoot?

Best Regards, Donald.

The OS that Immich Server is running on

Photonos linux kernel 5.10.175-4.ph4-esx via Portainer virtualised via ESXi

Version of Immich Server

release

Version of Immich Mobile App

release

Platform with the issue

Your docker-compose.yml content

immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:release
    entrypoint: ["/bin/sh", "./start-server.sh"]
#    env_file:
#      - /home/dockers/immich/config/.env
    environment:
      - DB_HOSTNAME=postgresql.mydomainhere.com
      - DB_PORT=5432
      - DB_USERNAME=immich
      - DB_PASSWORD=*redacted*
      - DB_DATABASE_NAME=immich
      - REDIS_HOSTNAME=redis.mydomainhere.com
      - REDIS_PORT=6379
      - TYPESENSE_API_KEY=*redacted*
      - IMMICH_WEB_URL=http://photo.mydomainhere.com:3006
      - IMMICH_SERVER_URL=http://photo.mydomainhere.com:3007
      - IMMICH_MACHINE_LEARNING_URL=http://photo.mydomainhere.com:3008
    volumes:
      - /home/dockers/immich/uploads:/usr/src/app/upload
#    depends_on:
#      - redis
#      - database
#      - typesense
    ports:
      - 3007:3001
    restart: always
  immich-microservices:
    container_name: immich_microservices
    image: ghcr.io/immich-app/immich-server:release
    entrypoint: ["/bin/sh", "./start-microservices.sh"]
    volumes:
      - /home/dockers/immich/uploads:/usr/src/app/upload
#    depends_on:
#      - redis
#      - database
#      - typesense
    restart: always
  immich-machine-learning:
    container_name: immich_machine_learning
    image: ghcr.io/immich-app/immich-machine-learning:release
#    env_file:
#      - /home/dockers/immich/config/.env
    volumes:
      - /home/dockers/immich/uploads:/usr/src/app/upload
      - /home/dockers/immich/model-cache:/cache
    restart: always
    ports:
      - 3008:3003
  immich-web:
    container_name: immich_web
    image: ghcr.io/immich-app/immich-web:release
    entrypoint: ["/bin/sh", "./entrypoint.sh"]
#    env_file:
#      - /home/dockers/immich/config/.env
    restart: always
    ports:
      - 3006:3000
    environment:
      - IMMICH_WEB_URL=http://photo.mydomainhere.com:3006
      - IMMICH_SERVER_URL=http://photo.mydomainhere.com:3007
      - IMMICH_MACHINE_LEARNING_URL=http://photo.mydomainhere.com:3008
  typesense:
    container_name: immich_typesense
    image: typesense/typesense:0.24.0
    environment:
      - TYPESENSE_API_KEY=*redacted*
      - TYPESENSE_DATA_DIR=/data
#    logging:
#      driver: none
    volumes:
      - /home/dockers/immich/tsdata:/data
    restart: always

Your .env content

Somehow portainer won't read the .env so I configured them as environment variables in the docker-compose file.

Reproduction steps

1. Install using docker-compose file and set the environment variables of .env file manually in compose file.
2. Browse to the web server of immich (via reverse proxy).
3. Press the getting started button, try to sign up an administrator for the first time.

Additional information

Reverse proxy configuration:

root@dockers [ /home/dockers/swag/nginx/proxy-confs ]# cat immich.subdomain.conf
## Version 2023/02/05
# Ensure your DNS has a CNAME set for Immich and that Immich container is named.

server {
    listen 443 ssl;
    listen [::]:443 ssl;

    server_name photo.*;

    include /config/nginx/ssl.conf;

    client_max_body_size 0;

    # enable for ldap auth (requires ldap-location.conf in the location block)
    #include /config/nginx/ldap-server.conf;

    # enable for Authelia (requires authelia-location.conf in the location block)
    #include /config/nginx/authelia-server.conf;

    # enable for Authentik (requires authentik-location.conf in the location block)
    #include /config/nginx/authentik-server.conf;

    location / {
        # enable the next two lines for http auth
        #auth_basic "Restricted";
        #auth_basic_user_file /config/nginx/.htpasswd;

        # enable for ldap auth (requires ldap-server.conf in the server block)
        #include /config/nginx/ldap-location.conf;

        # enable for Authelia (requires authelia-server.conf in the server block)
        #include /config/nginx/authelia-location.conf;

        # enable for Authentik (requires authentik-server.conf in the server block)
        #include /config/nginx/authentik-location.conf;

        include /config/nginx/proxy.conf;
        include /config/nginx/resolver.conf;
        set $upstream_app photo.mydomainhere.com;
        set $upstream_port 3006;
        set $upstream_proto http;
        proxy_pass $upstream_proto://$upstream_app:$upstream_port;

    }
}
root@dockers [ /home/dockers/swag/nginx/proxy-confs ]#
alextran1502 commented 1 year ago

Can you check your server and microservices log? You commented out some of the depends on clause which can mess up the start up sequence.

Here is the guide to setup Immich on Portainer that use the .env file or stack.env to be exact

https://immich.app/docs/install/portainer

megapearl commented 1 year ago

Wow you're fast replying...

You're right, I think I set the environment variables to the wrong docker, will read the install portainer link you mentioned. Error: Config validation error: "DB_USERNAME" is required. "DB_PASSWORD" is required. "DB_DATABASE_NAME" is required. "TYPESENSE_API_KEY" is required

azais-corentin commented 1 year ago

I have the same issue with a fresh installl, following the docker compose + .env given here. The only thing changed is that I use Caddy as a reverse proxy.

Chrome console gives me a HTTP POST 404 error when I click the register button: (address blurred) 00147_chrome_Ruy196Zal2

Could it be a misconfiguration of the IMMICH_*_URL environment variables?

Edit: Got it to work! I now see that it was a misconfiguration of the reverse proxy, as written in the documentation. For future reference, here's my Caddy configuration:

immich.mydomain.com {
    route /api/* {
        uri strip_prefix /api
        reverse_proxy immich-server:3001
    }

    reverse_proxy immich-web:3000
}
bo0tzz commented 1 year ago

@megapearl you've configured this:

    environment:
      - IMMICH_WEB_URL=http://photo.mydomainhere.com:3006
      - IMMICH_SERVER_URL=http://photo.mydomainhere.com:3007
      - IMMICH_MACHINE_LEARNING_URL=http://photo.mydomainhere.com:3008

Unless you have a very custom setup and those services are indeed reachable at those URLs, that is probably incorrect. The default values should work :)

megapearl commented 1 year ago

@bo0tzz Yes, I have a custom setup, because other services are already running at the standard immich ports (3000 to 3003) and I already have postgresql redis and a reverse proxy (nginx via swag) running for some other dockers and want to minimize the load of the server which is too high at the moment. At the moment I'm configuring immich using the https://immich.app/docs/install/portainer which I somehow missed.

bo0tzz commented 1 year ago

Immich's ports are internal except for the 2283 port on the proxy, so you shouldn't need to change anything about that.

megapearl commented 1 year ago

Yes, internal, but I have other services running (compreface and frigate for example) which are also running on that ports, so I mapped it to another port as I'm not using the 'host' mode in the docker-compose. And I'm not using the proxy of immich because I already have a proxy running doing the same thing.

jrasm91 commented 1 year ago

It is obviously misconfigured and we're trying to tell you those envs are probably wrong. There is no need to change any ports if you're using a bridge network for the stack.

megapearl commented 1 year ago

Yes, your comments are valued, that's why I'm starting over using https://immich.app/docs/install/portainer which I mentioned earlier. With some slight modifications using the already running redis postgresql and swag/nginx reverse proxy to minimize the load of the server.

jrasm91 commented 1 year ago

Perfect, sounds good!

megapearl commented 1 year ago

Used the instructions that I missed on https://immich.app/docs/install/portainer and https://immich.app/docs/administration/reverse-proxy and adjusted the urls to redis and postgresql and Immich is up and running now. Thanks for all feedback!