linuxserver / docker-hedgedoc

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

error for 1.8.0 image #12

Closed andrewzah closed 3 years ago

andrewzah commented 3 years ago

details

version: ghcr.io/linuxserver/hedgedoc:version-1.8.0 system: docker

bug

I get a 500 error when attempting to visit hedgedoc after starting the container.

hedgedoc_1         | SyntaxError: missing ) after argument list in /opt/hedgedoc/public/views/index.ejs while compiling ejs
hedgedoc_1         | 
hedgedoc_1         | If the above error is not helpful, you may want to try EJS-Lint:
hedgedoc_1         | https://github.com/RyanZim/EJS-Lint
hedgedoc_1         | Or, if you meant to create an async function, pass `async: true` as an option.
hedgedoc_1         |     at new Function (<anonymous>)
hedgedoc_1         |     at Template.compile (/opt/hedgedoc/node_modules/ejs/lib/ejs.js:662:12)
hedgedoc_1         |     at Object.compile (/opt/hedgedoc/node_modules/ejs/lib/ejs.js:396:16)
hedgedoc_1         |     at handleCache (/opt/hedgedoc/node_modules/ejs/lib/ejs.js:233:18)
hedgedoc_1         |     at tryHandleCache (/opt/hedgedoc/node_modules/ejs/lib/ejs.js:272:16)
hedgedoc_1         |     at View.exports.renderFile [as engine] (/opt/hedgedoc/node_modules/ejs/lib/ejs.js:489:10)
hedgedoc_1         |     at View.render (/opt/hedgedoc/node_modules/express/lib/view.js:135:8)
hedgedoc_1         |     at tryRender (/opt/hedgedoc/node_modules/express/lib/application.js:640:10)
hedgedoc_1         |     at Function.render (/opt/hedgedoc/node_modules/express/lib/application.js:592:3)
hedgedoc_1         |     at ServerResponse.render (/opt/hedgedoc/node_modules/express/lib/response.js:1012:7)
hedgedoc_1         |     at showIndex (/opt/hedgedoc/lib/response.js:47:9)
hedgedoc_1         |     at Layer.handle [as handle_request] (/opt/hedgedoc/node_modules/express/lib/router/layer.js:95:5)
hedgedoc_1         |     at next (/opt/hedgedoc/node_modules/express/lib/router/route.js:137:13)
hedgedoc_1         |     at Route.dispatch (/opt/hedgedoc/node_modules/express/lib/router/route.js:112:3)
hedgedoc_1         |     at Layer.handle [as handle_request] (/opt/hedgedoc/node_modules/express/lib/router/layer.js:95:5)
hedgedoc_1         |     at /opt/hedgedoc/node_modules/express/lib/router/index.js:281:22
hedgedoc_1         |     at Function.process_params (/opt/hedgedoc/node_modules/express/lib/router/index.js:335:12)
hedgedoc_1         |     at next (/opt/hedgedoc/node_modules/express/lib/router/index.js:275:10)
hedgedoc_1         |     at Function.handle (/opt/hedgedoc/node_modules/express/lib/router/index.js:174:3)
hedgedoc_1         |     at router (/opt/hedgedoc/node_modules/express/lib/router/index.js:47:12)
hedgedoc_1         |     at Layer.handle [as handle_request] (/opt/hedgedoc/node_modules/express/lib/router/layer.js:95:5)
hedgedoc_1         |     at trim_prefix (/opt/hedgedoc/node_modules/express/lib/router/index.js:317:13)
github-actions[bot] commented 3 years ago

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

tobbenb commented 3 years ago

Please fill out the issue template.

andrewzah commented 3 years ago

...


name: Bug report about: hedgedoc 500 err in 1.8.0


Expected Behavior

Hedgedoc should be visitable after launching the container.

Current Behavior

Hedgedoc returns a 500 err upon visiting the service.

Steps to Reproduce

  1. Run ghcr.io/linuxserver/hedgedoc:version-1.8.0 or latest
  2. Visit the service address & port

Environment

OS: debian CPU architecture: x86_64 How docker service was installed: pulled from ghcr.io/linuxserver/hedgedoc:1.8.0

      DB_HOST: '<host>'
      DB_USER: '<user>'
      DB_NAME: '<name>'
      DB_PORT: 3306
      PGID: 1000
      PUID: 1000
      TZ: 'America/New_York'

      CMD_ALLOW_ANONYMOUS: 'false'
      CMD_ALLOW_FREEURL: 'true'
      CMD_REQUIRE_FREEURL_AUTHENTICATION: 'true'
      # actually uses libravatar
      CMD_ALLOW_GRAVATAR: 'true' 
      CMD_EMAIL: 'false'
      CMD_ALLOW_EMAIL_REGISTER: 'false'
      CMD_USECDN: 'false'

      # keycloak oauth
      CMD_DOMAIN: '<domain>'
      CMD_OAUTH2_CLIENT_ID: '<client>'
      CMD_OAUTH2_PROVIDERNAME: 'keycloak'
      CMD_OAUTH2_USER_PROFILE_USERNAME_ATTR: 'preferred_username'
      CMD_OAUTH2_USER_PROFILE_DISPLAY_NAME_ATTR: 'name'
      CMD_OAUTH2_USER_PROFILE_EMAIL_ATTR: 'email'
      CMD_OAUTH2_AUTHORIZATION_URL: '<url'
      CMD_OAUTH2_TOKEN_URL: '<url>'
      CMD_OAUTH2_USER_PROFILE_URL: '<url>'
      CMD_PROTOCOL_USESSL: 'true'
      CMD_URL_ADDPORT: 'false'

Docker logs

hedgedoc_1         | SyntaxError: missing ) after argument list in /opt/hedgedoc/public/views/index.ejs while compiling ejs
hedgedoc_1         | 
hedgedoc_1         | If the above error is not helpful, you may want to try EJS-Lint:
hedgedoc_1         | https://github.com/RyanZim/EJS-Lint
hedgedoc_1         | Or, if you meant to create an async function, pass `async: true` as an option.
hedgedoc_1         |     at new Function (<anonymous>)
hedgedoc_1         |     at Template.compile (/opt/hedgedoc/node_modules/ejs/lib/ejs.js:662:12)
hedgedoc_1         |     at Object.compile (/opt/hedgedoc/node_modules/ejs/lib/ejs.js:396:16)
hedgedoc_1         |     at handleCache (/opt/hedgedoc/node_modules/ejs/lib/ejs.js:233:18)
hedgedoc_1         |     at tryHandleCache (/opt/hedgedoc/node_modules/ejs/lib/ejs.js:272:16)
hedgedoc_1         |     at View.exports.renderFile [as engine] (/opt/hedgedoc/node_modules/ejs/lib/ejs.js:489:10)
hedgedoc_1         |     at View.render (/opt/hedgedoc/node_modules/express/lib/view.js:135:8)
hedgedoc_1         |     at tryRender (/opt/hedgedoc/node_modules/express/lib/application.js:640:10)
hedgedoc_1         |     at Function.render (/opt/hedgedoc/node_modules/express/lib/application.js:592:3)
hedgedoc_1         |     at ServerResponse.render (/opt/hedge doc/node_modules/express/lib/response.js:1012:7)
hedgedoc_1         |     at showIndex (/opt/hedgedoc/lib/response.js:47:9)
hedgedoc_1         |     at Layer.handle [as handle_request] (/opt/hedgedoc/node_modules/express/lib/router/layer.js:95:5)
hedgedoc_1         |     at next (/opt/hedgedoc/node_modules/express/lib/router/route.js:137:13)
hedgedoc_1         |     at Route.dispatch (/opt/hedgedoc/node_modules/express/lib/router/route.js:112:3)
hedgedoc_1         |     at Layer.handle [as handle_request] (/opt/hedgedoc/node_modules/express/lib/router/layer.js:95:5)
hedgedoc_1         |     at /opt/hedgedoc/node_modules/express/lib/router/index.js:281:22
hedgedoc_1         |     at Function.process_params (/opt/hedgedoc/node_modules/express/lib/router/index.js:335:12)
hedgedoc_1         |     at next (/opt/hedgedoc/node_modules/express/lib/router/index.js:275:10)
hedgedoc_1         |     at Function.handle (/opt/hedgedoc/node_modules/express/lib/router/index.js:174:3)
hedgedoc_1         |     at router (/opt/hedgedoc/node_modules/express/lib/router/index.js:47:12)
hedgedoc_1         |     at Layer.handle [as handle_request] (/opt/hedgedoc/node_modules/express/lib/router/layer.js:95:5)
hedgedoc_1         |     at trim_prefix (/opt/hedgedoc/node_modules/express/lib/router/index.js:317:13)
aptalca commented 3 years ago

You still didn't provide all the info we requested, but I'll bite anyway.

As you can see here, our smoke test passes successfully on all arches: https://ci-tests.linuxserver.io/linuxserver/hedgedoc/latest/index.html

You are setting a ton of env vars that only the upstream app recognizes and likely an incorrect setting or an upstream bug is causing what you're observing. You should report it to them.

andrewzah commented 3 years ago

The same issue occurs when no env vars are set other than DB vars.

tobbenb commented 3 years ago

You don't give us the info we need, so no help. Since the smoke tests works in our testing, this is a user issue. So please use our discourse forum or discord to get support. You can find the links in linuxserver.io/support

andrewzah commented 3 years ago

What more information do you need? I followed the template that you guys gave, it's a standard docker installation........

Roxedus commented 3 years ago

I don't see a full compose or log

andrewzah commented 3 years ago

I gave you the pertinent information. I'm not sure what else you're expecting to see, but here:

services:
  mysql:
    image: mysql:5.7
    environment:
      MYSQL_ROOT_HOST: '192.168.1.%'
    env_file:
      - "${COMPOSE_ROOT}/services/mysql/secret.env"
    volumes:
      - "${COMPOSE_ROOT}/data/mysql:/var/lib/mysql"
    ports:
      - "3306"
    restart: unless-stopped

  hedgedoc:
    # 05-04-21
    #image: ghcr.io/linuxserver/hedgedoc:version-1.7.2
    image: ghcr.io/linuxserver/hedgedoc:version-1.8.0 
    #image: andrewzah/hedgedoc:1.8.0
    environment:
      DB_HOST: 'mysql'
      DB_USER: 'hedgedoc'
      DB_NAME: 'hedgedoc'
      DB_PORT: 3306
      PGID: 1000
      PUID: 1000
      TZ: 'America/New_York'

      #CMD_ALLOW_ANONYMOUS: 'false'
      #CMD_ALLOW_FREEURL: 'true'
      #CMD_REQUIRE_FREEURL_AUTHENTICATION: 'true'
      ## actually uses libravatar
      #CMD_ALLOW_GRAVATAR: 'true' 
      #CMD_EMAIL: 'false'
      #CMD_ALLOW_EMAIL_REGISTER: 'false'
      #CMD_USECDN: 'false'

      ## keycloak oauth
      CMD_DOMAIN: '<host>'
      #CMD_OAUTH2_CLIENT_ID: 'hedgedoc'
      #CMD_OAUTH2_PROVIDERNAME: 'keycloak'
      #CMD_OAUTH2_USER_PROFILE_USERNAME_ATTR: 'preferred_username'
      #CMD_OAUTH2_USER_PROFILE_DISPLAY_NAME_ATTR: 'name'
      #CMD_OAUTH2_USER_PROFILE_EMAIL_ATTR: 'email'
      #CMD_OAUTH2_AUTHORIZATION_URL: 'https://idp.zah.rocks/auth/realms/lilac/protocol/openid-connect/auth'
      #CMD_OAUTH2_TOKEN_URL: 'https://idp.zah.rocks/auth/realms/lilac/protocol/openid-connect/token'
      #CMD_OAUTH2_USER_PROFILE_URL: 'https://idp.zah.rocks/auth/realms/lilac/protocol/openid-connect/userinfo'
      #CMD_PROTOCOL_USESSL: 'true'
      #CMD_URL_ADDPORT: 'false'

    ports:
      - "3000"
    env_file:
      - "${COMPOSE_ROOT}/services/hedgedoc/secret.env"
    restart: unless-stopped
    depends_on:
      - keycloak
      - mysql
    volumes:
      - "${COMPOSE_ROOT}/data/hedgedoc/config/:/config/:rw"
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.hedgedoc.rule=Host(`<host>`)"
      - "traefik.http.routers.hedgedoc.entrypoints=websecure"
      #- 'traefik.http.routers.hedgedoc.middlewares=eas-default'
      - "traefik.http.routers.hedgedoc.tls.certresolver=myresolver"
andrew@docker:~/docker/services/hedgedoc$ ../../compose.sh logs hedgedoc
Attaching to andrewzah_hedgedoc_1
hedgedoc_1         | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
hedgedoc_1         | [s6-init] ensuring user provided files have correct perms...exited 0.
hedgedoc_1         | [fix-attrs.d] applying ownership & permissions fixes...
hedgedoc_1         | [fix-attrs.d] done.
hedgedoc_1         | [cont-init.d] executing container initialization scripts...
hedgedoc_1         | [cont-init.d] 01-envfile: executing... 
hedgedoc_1         | [cont-init.d] 01-envfile: exited 0.
hedgedoc_1         | [cont-init.d] 10-adduser: executing... 
hedgedoc_1         | 
hedgedoc_1         | -------------------------------------
hedgedoc_1         |           _         ()
hedgedoc_1         |          | |  ___   _    __
hedgedoc_1         |          | | / __| | |  /  \ 
hedgedoc_1         |          | | \__ \ | | | () |
hedgedoc_1         |          |_| |___/ |_|  \__/
hedgedoc_1         | 
hedgedoc_1         | 
hedgedoc_1         | Brought to you by linuxserver.io
hedgedoc_1         | -------------------------------------
hedgedoc_1         | 
hedgedoc_1         | To support LSIO projects visit:
hedgedoc_1         | https://www.linuxserver.io/donate/
hedgedoc_1         | -------------------------------------
hedgedoc_1         | GID/UID
hedgedoc_1         | -------------------------------------
hedgedoc_1         | 
hedgedoc_1         | User uid:    1000
hedgedoc_1         | User gid:    1000
hedgedoc_1         | -------------------------------------
hedgedoc_1         | 
hedgedoc_1         | [cont-init.d] 10-adduser: exited 0.
hedgedoc_1         | [cont-init.d] 30-config: executing... 
hedgedoc_1         | [cont-init.d] 30-config: exited 0.
hedgedoc_1         | [cont-init.d] 99-custom-scripts: executing... 
hedgedoc_1         | [custom-init] no custom files found exiting...
hedgedoc_1         | [cont-init.d] 99-custom-scripts: exited 0.
hedgedoc_1         | [cont-init.d] done.
hedgedoc_1         | [services.d] starting services
hedgedoc_1         | [services.d] done.
hedgedoc_1         | 2021-05-04T16:22:36.761Z warn:     Session secret not set. Using random generated one. Please set `sessionSecret` in your config.json file. All users will be logged out.
hedgedoc_1         | 2021-05-04T16:22:37.123Z info:     All migrations performed successfully
hedgedoc_1         | 2021-05-04T16:22:37.130Z info:     HTTP Server listening at 0.0.0.0:3000
hedgedoc_1         | SyntaxError: missing ) after argument list in /opt/hedgedoc/public/views/index.ejs while compiling ejs
hedgedoc_1         | 
hedgedoc_1         | If the above error is not helpful, you may want to try EJS-Lint:
hedgedoc_1         | https://github.com/RyanZim/EJS-Lint
hedgedoc_1         | Or, if you meant to create an async function, pass `async: true` as an option.
hedgedoc_1         |     at new Function (<anonymous>)
hedgedoc_1         |     at Template.compile (/opt/hedgedoc/node_modules/ejs/lib/ejs.js:662:12)
hedgedoc_1         |     at Object.compile (/opt/hedgedoc/node_modules/ejs/lib/ejs.js:396:16)
hedgedoc_1         |     at handleCache (/opt/hedgedoc/node_modules/ejs/lib/ejs.js:233:18)
hedgedoc_1         |     at tryHandleCache (/opt/hedgedoc/node_modules/ejs/lib/ejs.js:272:16)
hedgedoc_1         |     at View.exports.renderFile [as engine] (/opt/hedgedoc/node_modules/ejs/lib/ejs.js:489:10)
hedgedoc_1         |     at View.render (/opt/hedgedoc/node_modules/express/lib/view.js:135:8)
hedgedoc_1         |     at tryRender (/opt/hedgedoc/node_modules/express/lib/application.js:640:10)
hedgedoc_1         |     at Function.render (/opt/hedgedoc/node_modules/express/lib/application.js:592:3)
hedgedoc_1         |     at ServerResponse.render (/opt/hedgedoc/node_modules/express/lib/response.js:1012:7)
hedgedoc_1         |     at showIndex (/opt/hedgedoc/lib/response.js:47:9)
hedgedoc_1         |     at Layer.handle [as handle_request] (/opt/hedgedoc/node_modules/express/lib/router/layer.js:95:5)
hedgedoc_1         |     at next (/opt/hedgedoc/node_modules/express/lib/router/route.js:137:13)
hedgedoc_1         |     at Route.dispatch (/opt/hedgedoc/node_modules/express/lib/router/route.js:112:3)
hedgedoc_1         |     at Layer.handle [as handle_request] (/opt/hedgedoc/node_modules/express/lib/router/layer.js:95:5)
hedgedoc_1         |     at /opt/hedgedoc/node_modules/express/lib/router/index.js:281:22
hedgedoc_1         |     at Function.process_params (/opt/hedgedoc/node_modules/express/lib/router/index.js:335:12)
hedgedoc_1         |     at next (/opt/hedgedoc/node_modules/express/lib/router/index.js:275:10)
hedgedoc_1         |     at Function.handle (/opt/hedgedoc/node_modules/express/lib/router/index.js:174:3)
hedgedoc_1         |     at router (/opt/hedgedoc/node_modules/express/lib/router/index.js:47:12)
hedgedoc_1         |     at Layer.handle [as handle_request] (/opt/hedgedoc/node_modules/express/lib/router/layer.js:95:5)
hedgedoc_1         |     at trim_prefix (/opt/hedgedoc/node_modules/express/lib/router/index.js:317:13)
hedgedoc_1         | 2021-05-04T16:22:45.098Z info:     192.168.1.5 - - [04/May/2021:16:22:45 +0000] "GET / HTTP/1.1" 500 148 "-" "Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Firefox/78.0"
hedgedoc_1         | 

I had 1.7.2 working for a while, but 1.8.0 does not work.

andrewzah commented 3 years ago

I'm 99% certain this was the issue, caused by state from 1.7.2->1.8.0 most likely:

andrew@docker:~/docker/data$ cat hedgedoc-1.7.2/config/views/index.ejs 
<!DOCTYPE html>
<html lang="en">

<head>
    <%- include index/head %>
</head>

<body>
    <%- include index/header %>
    <%- include index/body %>
    <%- include index/footer %>
</body>

</html>
andrew@docker:~/docker/data$ cat hedgedoc-1.8.0/config/views/index.ejs 
<!DOCTYPE html>
<html>

<head>
    <%- include('index/head') %>
</head>

<body>
    <%- include('index/header') %>
    <%- include('index/body') %>
    <%- include('index/footer') %>
</body>

</html>

As to why hedgedoc stores these under /config, I have no idea. Do your tests track config states from different versions?


I just wanted to state that I have never seen such prompt responses on an issue, that are so useless and unhelpful. Perhaps you should try reading what people write. I can only hope that the rest of the linuxserver images aren't managed by people as incompetent/disaffected as you lot.

tobbenb commented 3 years ago

This would have been avoided if you supplied what we asked for and not just snippets that you think was important. It's the reason we have the issue template, and when people doesn't fill in the issue template we kindly ask them to fill out and we have to drag the information out of them, we don't start looking at the issue as they are wasting our time that we could be using on our family/friends/helping others that actually respect that we use our free time to make, maintain and help users get it running. So if you feel that we are so horrible, you are free to not use our containers and go somewhere else.