linuxserver / docker-hedgedoc

GNU General Public License v3.0
43 stars 7 forks source link

manage_users hangs #32

Closed cwesterfield closed 1 year ago

cwesterfield commented 2 years ago

linuxserver.io


Expected Behavior

root@bc4413c963ad:/app/hedgedoc/bin# ./manage_users --add test@test

It should ask for a password and create an account

Current Behavior

root@bc4413c963ad:/app/hedgedoc/bin# ./manage_users --add test@test

just hangs indefinitely

Steps to Reproduce

  1. console into container
  2. cd into /app/hedgedoc/bin
  3. run ./manage_users --add test@test

Environment

OS: Debian CPU architecture: x86_64 How docker service was installed: from debian repo

Command used to create docker container (run/create/compose/screenshot)

services:
  mariadb:
    image: lscr.io/linuxserver/mariadb:latest
    container_name: hedgedoc_mariadb
    restart: always
    volumes:
      - /srv/hedgedoc/mariadb/data:/config
    environment:
      - MYSQL_ROOT_PASSWORD=*******
      - MYSQL_DATABASE=hedgedoc
      - MYSQL_USER=hedgedoc
      - MYSQL_PASSWORD=*******
      - PGID=1000
      - PUID=1000
      - TZ=America/Chicago
  hedgedoc:
    image: lscr.io/linuxserver/hedgedoc:latest
    container_name: hedgedoc
    restart: always
    depends_on:
      - mariadb
    volumes:
      - /srv/hedgedoc/config:/config
    environment:
      - DB_HOST=mariadb
      - DB_USER=hedgedoc
      - DB_PASS=*******
      - DB_NAME=hedgedoc
      - DB_PORT=3306
      - PGID=1000
      - PUID=1000
      - TZ=America/Chicago
      - CMD_DOMAIN=notes.********.us
      - CMD_URL_ADDPORT=false #optional
      - CMD_PROTOCOL_USESSL=true #optional
      - CMD_PORT=3001 #optional
      - CMD_ALLOW_ANONYMOUS=false
      - CMD_ALLOW_EMAIL_REGISTER=false
    ports:
      - "3001:3001" 

Docker logs

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 30-config: executing... 
Waiting for Mysql service
Waiting for Mysql service
Waiting for Mysql service
Waiting for Mysql service
Waiting for Mysql service
Waiting for Mysql service
Waiting for Mysql service
Waiting for Mysql service
Waiting for Mysql service
Waiting for Mysql service
Waiting for Mysql service
Waiting for Mysql service
Waiting for Mysql service
Waiting for Mysql service
Waiting for Mysql service
[cont-init.d] 30-config: exited 0.
[cont-init.d] 90-custom-folders: executing... 
[cont-init.d] 90-custom-folders: exited 0.
[cont-init.d] 99-custom-files: executing... 
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-files: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
2022-05-10T15:39:21.252Z warn:  Session secret not set. Using random generated one. Please set `sessionSecret` in your config.json file. All users will be logged out.
2022-05-10T15:39:21.948Z info:  == 20150504155329-create-users: migrating =======
2022-05-10T15:39:21.989Z info:  == 20150504155329-create-users: migrated (0.040s)

2022-05-10T15:39:22.010Z info:  == 20150508114741-create-notes: migrating =======
2022-05-10T15:39:22.032Z info:  == 20150508114741-create-notes: migrated (0.022s)

2022-05-10T15:39:22.046Z info:  == 20150515125813-create-temp: migrating =======
2022-05-10T15:39:22.064Z info:  == 20150515125813-create-temp: migrated (0.017s)

2022-05-10T15:39:22.072Z info:  == 20150702001020-update-to-0_3_1: migrating =======
2022-05-10T15:39:22.125Z info:  == 20150702001020-update-to-0_3_1: migrated (0.053s)

2022-05-10T15:39:22.131Z info:  == 20150915153700-change-notes-title-to-text: migrating =======
2022-05-10T15:39:22.165Z info:  == 20150915153700-change-notes-title-to-text: migrated (0.034s)

2022-05-10T15:39:22.170Z info:  == 20160112220142-note-add-lastchange: migrating =======
2022-05-10T15:39:22.187Z info:  == 20160112220142-note-add-lastchange: migrated (0.016s)

2022-05-10T15:39:22.193Z info:  == 20160420180355-note-add-alias: migrating =======
2022-05-10T15:39:22.213Z info:  == 20160420180355-note-add-alias: migrated (0.020s)

2022-05-10T15:39:22.219Z info:  == 20160515114000-user-add-tokens: migrating =======
2022-05-10T15:39:22.240Z info:  == 20160515114000-user-add-tokens: migrated (0.020s)

2022-05-10T15:39:22.246Z info:  == 20160607060246-support-revision: migrating =======
2022-05-10T15:39:22.280Z info:  == 20160607060246-support-revision: migrated (0.034s)

2022-05-10T15:39:22.287Z info:  == 20160703062241-support-authorship: migrating =======
2022-05-10T15:39:22.316Z info:  == 20160703062241-support-authorship: migrated (0.028s)

2022-05-10T15:39:22.322Z info:  == 20161009040430-support-delete-note: migrating =======
2022-05-10T15:39:22.332Z info:  == 20161009040430-support-delete-note: migrated (0.010s)

2022-05-10T15:39:22.340Z info:  == 20161201050312-support-email-signin: migrating =======
2022-05-10T15:39:22.357Z info:  == 20161201050312-support-email-signin: migrated (0.017s)

2022-05-10T15:39:22.361Z info:  == 20171009121200-longtext-for-mysql: migrating =======
2022-05-10T15:39:22.471Z info:  == 20171009121200-longtext-for-mysql: migrated (0.110s)

2022-05-10T15:39:22.476Z info:  == 20180209120907-longtext-of-authorship: migrating =======
2022-05-10T15:39:22.529Z info:  == 20180209120907-longtext-of-authorship: migrated (0.053s)

2022-05-10T15:39:22.534Z info:  == 20180306150303-fix-enum: migrating =======
2022-05-10T15:39:22.566Z info:  == 20180306150303-fix-enum: migrated (0.032s)

2022-05-10T15:39:22.572Z info:  == 20180326103000-use-text-in-tokens: migrating =======
2022-05-10T15:39:22.631Z info:  == 20180326103000-use-text-in-tokens: migrated (0.059s)

2022-05-10T15:39:22.636Z info:  == 20180525153000-user-add-delete-token: migrating =======
2022-05-10T15:39:22.647Z info:  == 20180525153000-user-add-delete-token: migrated (0.009s)

2022-05-10T15:39:22.650Z info:  == 20200321153000-fix-account-deletion: migrating =======
2022-05-10T15:39:23.535Z info:  == 20200321153000-fix-account-deletion: migrated (0.884s)

2022-05-10T15:39:23.536Z info:  All migrations performed successfully
2022-05-10T15:39:23.554Z info:  HTTP Server listening at 0.0.0.0:3001
2022-05-10T15:39:34.054Z info:  172.70.126.51 - - [10/May/2022:15:39:34 +0000] "GET / HTTP/1.1" 200 - "https://notes.*******.us/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36"

2022-05-10T15:39:34.134Z info:  172.70.126.51 - - [10/May/2022:15:39:34 +0000] "GET /config HTTP/1.1" 304 - "https://notes.*******.us/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36"

2022-05-10T15:39:34.271Z info:  172.70.126.51 - - [10/May/2022:15:39:34 +0000] "GET /me HTTP/1.1" 304 - "https://notes.*******.us/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36"
github-actions[bot] commented 2 years ago

Thanks for opening your first issue here! Be sure to follow the bug or feature issue templates!

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

andyongxa commented 2 years ago

i have the same issues

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

taintedkernel commented 2 years ago

I'm running on Kubernetes with the recommended Helm chart and running a similar problem:

root@hedgedoc-7746789df-gm5s8:/opt/hedgedoc/bin# ./manage_users --reset user@email.com
/bin/sh: 1: git: not found
(node:460) UnhandledPromiseRejectionWarning: SequelizeConnectionRefusedError: connect ECONNREFUSED 127.0.0.1:5432
    at Client._connectionCallback (/opt/hedgedoc/node_modules/sequelize/lib/dialects/postgres/connection-manager.js:170:24)
    at Client._handleErrorWhileConnecting (/opt/hedgedoc/node_modules/pg/lib/client.js:305:19)
    at Client._handleErrorEvent (/opt/hedgedoc/node_modules/pg/lib/client.js:315:19)
    at Connection.emit (events.js:314:20)
    at Socket.reportStreamError (/opt/hedgedoc/node_modules/pg/lib/connection.js:52:12)
    at Socket.emit (events.js:314:20)
    at emitErrorNT (internal/streams/destroy.js:92:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)
(node:460) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:460) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

In my case, it seems that the binary cannot connect to the webserver; I imagine running a k8s environment things may be different, but I did not see any option to specify a URL or host to override the default.

Edit: Scratch that, I was able to find a way with help from this comment.

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

MikeRatcliffe commented 1 year ago

I have the same issue :(

blaa commented 1 year ago

It seems problem occurs when the domain doesn't contain at least one dot. At least in my case. @internal - hangs, @internal.poo - works.

Some weird, unnecessary assumptions in play.

aptalca commented 1 year ago

This really should be reported to upstream and tracked there as it seems to be an app issue rather than a container issue. We don't develop the app, but only publish the container

tao-zamorano commented 1 year ago

Using NODE_DEBUG=net hinted that some network values were missing. Setting CMD_DB_URL=mysql://hedgedoc:some-pass@hedgedoc_mariadb:3306/hedgedoc, as suggested by taintedkernel, solved the problem for me.

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.

SteveDinn commented 1 year ago

I think this should be fixed. It seems really weird and very non-intuitive that the CMD_DB_URL environment variable is required when it could be composed from the other environment variables already required by the docker container.

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] commented 1 year ago

This issue is locked due to inactivity