shihjay2 / nosh3

About NOSH ChartingSystem is an electronic health record system designed exclusively for doctors and patients.
Other
10 stars 10 forks source link

Unauthorized access! error #8

Closed christian-geier closed 1 year ago

christian-geier commented 1 year ago

Hi, I'm trying to set up NOSH3 and I am getting an authentication error with Magic. The Magic authentication appears to work (sends a 3 digit token to my email) but when I enter this the login page then throws: "Unauthorized access" and I remain stuck at the login screen.

image

How can I fix this?

docker-compose.yml:

version: '3.7'
services:
  router:
    image: traefik:latest
    container_name: router
    ports:
      - 80:80
      - 443:443
    restart: always
    depends_on:
      - watchtower
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock:ro"
      - ./traefik-acme:/acme
    command:
      - "--api.insecure=true"
      - "--providers.docker=true"
      - "--providers.docker.exposedbydefault=false"
      - "--entrypoints.web.address=:80"
      - "--entrypoints.websecure.address=:443"
      - "--certificatesresolvers.web.acme.email=christian.geier@posteo.net"
      - "--certificatesresolvers.web.acme.storage=/acme/certs.json"
      - "--certificatesresolvers.web.acme.httpchallenge.entrypoint=web"
    labels:
      - "traefik.enable=false"
      - "com.centurylinklabs.watchtower.scope=nosh"
  couchdb:
    image: couchdb:latest
    container_name: couchdb
    restart: always
    depends_on:
      - router
      - watchtower
    env_file:
      - ./.env
    environment:
      COUCHDB_USER: ${COUCHDB_USER}
      COUCHDB_PASSWORD: ${COUCHDB_PASSWORD}
    volumes:
      - ./dbdata:/opt/couchdb/data
      - ./dbconfig:/opt/couchdb/etc/local.d
    labels:
      - "traefik.enable=true"
      - "traefik.docker.network=traefik_default"
      - "traefik.http.services.couchdb.loadbalancer.server.port=5984"
      - "traefik.http.routers.couchdb.entrypoints=web"
      - "traefik.http.routers.couchdb.rule=Host(`db.noshdemo.com`)"
      - "traefik.http.middlewares.couchdb-https-redirect.redirectscheme.scheme=https"
      - "traefik.http.routers.couchdb.middlewares=couchdb-https-redirect"
      - "traefik.http.routers.couchdb-secure.entrypoints=websecure"
      - "traefik.http.routers.couchdb-secure.rule=Host(`db.noshdemo.com`)"
      - "traefik.http.routers.couchdb-secure.tls=true"
      - "traefik.http.routers.couchdb-secure.tls.certresolver=web"
      - "traefik.http.routers.couchdb-secure.service=couchdb"
      - "com.centurylinklabs.watchtower.scope=nosh"
  nosh:
    image: shihjay2/nosh3
    container_name: nosh
    links:
      - couchdb
    restart: always
    depends_on:
      - couchdb
      - router
      - watchtower
    env_file:
      - ./.env
    labels:
      - "traefik.enable=true"
      - "traefik.docker.network=traefik_default"
      - "traefik.http.services.nosh.loadbalancer.server.port=4000"
      - "traefik.http.routers.nosh.entrypoints=web"
      - "traefik.http.routers.nosh.rule=Host(`noshdemo.com`)"
      - "traefik.http.middlewares.nosh-https-redirect.redirectscheme.scheme=https"
      - "traefik.http.routers.nosh.middlewares=nosh-https-redirect"
      - "traefik.http.routers.nosh-secure.entrypoints=websecure"
      - "traefik.http.routers.nosh-secure.rule=Host(`noshdemo.com`)"
      - "traefik.http.routers.nosh-secure.tls=true"
      - "traefik.http.routers.nosh-secure.tls.certresolver=web"
      - "traefik.http.routers.nosh-secure.service=nosh"
      - "com.centurylinklabs.watchtower.scope=nosh"
  watchtower:
    image: containrrr/watchtower
    container_name: watchtower
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    command: --interval 30 --scope nosh
    labels:
      - "traefik.enable=false"
networks:
  traefik_default:
    external: true

.env

MAGIC_API_KEY=****
MAILGUN_API_KEY=
SENDGRID_API_KEY=
MAILGUN_DOMAIN=
COUCHDB_URL=http://couchdb:5984
COUCHDB_USER=admin
COUCHDB_PASSWORD=password
COUCHDB_ENCRYPT_PIN=1234
INSTANCE=docker
# either [docker, digitalocean, local]
NOSH_DISPLAY="ChristianGeier"
NOSH_EMAIL=***
NOSH_ROLE=provider
# either [patient, provider]
AUTH=magic
# either [magic, trustee]
USPSTF_KEY=
UMLS_KEY=
OIDC_RELAY_URL=

docker logs $(docker ps -aqf "name=^nosh$") -f

listening on 4000
GET /app/login 304 - - 23.574 ms
GET /app/js/chunk-vendors.04d989e2.js 304 - - 2.469 ms
GET /auth/config 304 - - 6.383 ms
GET /app/img/icons/favicon.svg 304 - - 2.747 ms
GET /app/img/icons/android-chrome-192x192.png 304 - - 3.014 ms
GET /app/service-worker.js 304 - - 1.056 ms
GET /app/workbox-db5fc017.js 304 - - 1.030 ms
POST /auth/authenticate 401 13 - 592.136 ms
GET /auth/jwks 304 - - 61.745 ms
GET /start 302 104 - 50.095 ms
GET /app/login 304 - - 3.142 ms
GET /app/js/chunk-vendors.04d989e2.js 304 - - 1.100 ms
GET /auth/config 304 - - 1.413 ms
GET /app/img/icons/android-chrome-192x192.png 304 - - 1.158 ms
GET /app/service-worker.js 304 - - 1.442 ms
GET /app/workbox-db5fc017.js 304 - - 0.924 ms
POST /auth/authenticate 401 13 - 42.417 ms
GET /auth/jwks 304 - - 36.930 ms

docker logs $(docker ps -aqf "name=^router$") -f

time="2023-06-19T15:41:55Z" level=info msg="Configuration loaded from flags."

docker logs $(docker ps -aqf "name=^couchdb$") -f

[info] 2023-06-19T18:33:33.055837Z nonode@nohost <0.248.0> -------- Preflight check: Checking For Monsters

[info] 2023-06-19T18:33:33.059610Z nonode@nohost <0.248.0> -------- Preflight check: Asserting Admin Account

[info] 2023-06-19T18:33:33.067452Z nonode@nohost <0.248.0> -------- Apache CouchDB 3.3.2 is starting.

[info] 2023-06-19T18:33:33.067608Z nonode@nohost <0.249.0> -------- Starting couch_sup
[info] 2023-06-19T18:33:33.186515Z nonode@nohost <0.248.0> -------- Apache CouchDB has started. Time to relax.

[notice] 2023-06-19T18:33:33.212209Z nonode@nohost <0.281.0> -------- rexi_server : started servers
[notice] 2023-06-19T18:33:33.217040Z nonode@nohost <0.285.0> -------- rexi_buffer : started servers
[notice] 2023-06-19T18:33:33.419969Z nonode@nohost <0.316.0> -------- mem3_reshard_dbdoc start init()
[notice] 2023-06-19T18:33:33.432439Z nonode@nohost <0.318.0> -------- mem3_reshard start init()
[notice] 2023-06-19T18:33:33.432664Z nonode@nohost <0.319.0> -------- mem3_reshard db monitor <0.319.0> starting
[notice] 2023-06-19T18:33:33.440715Z nonode@nohost <0.318.0> -------- mem3_reshard starting reloading jobs
[notice] 2023-06-19T18:33:33.441481Z nonode@nohost <0.318.0> -------- mem3_reshard finished reloading jobs
[info] 2023-06-19T18:33:33.515386Z nonode@nohost <0.325.0> -------- Apache CouchDB has started. Time to relax.

[info] 2023-06-19T18:33:33.515986Z nonode@nohost <0.325.0> -------- Apache CouchDB has started on http://any:5984/
[notice] 2023-06-19T18:33:33.793941Z nonode@nohost <0.415.0> -------- All system databases exist.
[notice] 2023-06-19T18:33:38.610351Z nonode@nohost <0.377.0> -------- couch_replicator_clustering : cluster stable
[notice] 2023-06-19T18:33:38.626326Z nonode@nohost <0.399.0> -------- Started replicator db changes listener <0.516.0>
[info] 2023-06-19T18:33:38.628754Z nonode@nohost <0.518.0> -------- open_result error {not_found,no_db_file} for _replicator
[notice] 2023-06-19T18:33:39.025271Z nonode@nohost <0.500.0> b624800fc5 couchdb:5984 172.18.0.5 admin GET /users/ 200 ok 135
[notice] 2023-06-19T18:33:39.235633Z nonode@nohost <0.501.0> ecef59767e couchdb:5984 172.18.0.5 admin POST /users/_find 200 ok 180
[notice] 2023-06-19T18:33:39.407685Z nonode@nohost <0.502.0> 9a2f134efa couchdb:5984 172.18.0.5 admin GET /keys/ 200 ok 16
[notice] 2023-06-19T18:33:39.445799Z nonode@nohost <0.503.0> ef7f90dea8 couchdb:5984 172.18.0.5 admin POST /keys/_find 200 ok 36
[notice] 2023-06-19T18:33:48.213194Z nonode@nohost <0.281.0> -------- rexi_server : cluster stable
[notice] 2023-06-19T18:33:48.213310Z nonode@nohost <0.285.0> -------- rexi_buffer : cluster stable
[notice] 2023-06-19T18:36:35.166605Z nonode@nohost <0.1999.0> 35154b72d2 couchdb:5984 172.18.0.5 admin GET /_users/ 200 ok 19
[notice] 2023-06-19T18:36:44.772005Z nonode@nohost <0.2099.0> c463c8e716 couchdb:5984 172.18.0.5 admin GET /users/ 200 ok 16
[notice] 2023-06-19T18:36:44.791596Z nonode@nohost <0.2100.0> 73216801ef couchdb:5984 172.18.0.5 admin POST /users/_find 200 ok 14
[notice] 2023-06-19T18:36:44.952663Z nonode@nohost <0.2101.0> 3a546b3ec3 couchdb:5984 172.18.0.5 admin GET /keys/ 200 ok 15
[notice] 2023-06-19T18:36:44.970636Z nonode@nohost <0.2102.0> 9717b693df couchdb:5984 172.18.0.5 admin POST /keys/_find 200 ok 14
shihjay2 commented 1 year ago

You are getting this error because the email address you entered in the login screen has not been added as a user in your NOSH3. Make sure the first time you enter NOSH3 is the same email that you entered during the installation script (the one in the .env file) if you followed the instructions in the README. To add additional users, you'll need to click on the 3 dots on the upper right, select Users and Add Users. Make sure that the user is also toggled as active (not by default).

christian-geier commented 1 year ago

I have confirmed that it is the same email address in the login screen and the .env file but still get this error :/ any other idea?

shihjay2 commented 1 year ago

Try logging in and please share what console shows in the browser. I updated the code to debug where the problem might be coming from. You can check docker image ls to confirm that the NOSH docker image (shihjay2/nosh3) has updated recently. Image ID 5f89232df03c.

christian-geier commented 1 year ago

Thanks, here is the console output

registerServiceWorker.js:8 App is being served from cache by a service worker. For more details, visit https://goo.gl/AFskqB registerServiceWorker.js:14 Service worker has been registered. xhr.js:220 POST https://noshdemo.com/auth/authenticate 401 (anonymous) @ xhr.js:220 e.exports @ xhr.js:16 e.exports @ dispatchRequest.js:58 h.request @ Axios.js:109 (anonymous) @ Axios.js:144 (anonymous) @ bind.js:9 _ @ LoginView.vue:251 h @ LoginView.vue:365 await in h (async) (anonymous) @ vee-validate.esm.js:2113 Promise.then (async) (anonymous) @ vee-validate.esm.js:2105 l @ runtime-core.esm-bundler.js:173 c @ runtime-core.esm-bundler.js:182 n @ runtime-dom.esm-bundler.js:345 LoginView.vue:255 r {message: 'Request failed with status code 401', name: 'AxiosError', code: 'ERR_BAD_REQUEST', config: {…}, request: XMLHttpRequest, …}code: "ERR_BAD_REQUEST"config: {transitional: {…}, transformRequest: Array(1), transformResponse: Array(1), timeout: 0, adapter: ƒ, …}message: "Request failed with status code 401"name: "AxiosError"request: XMLHttpRequest {onreadystatechange: null, readyState: 4, timeout: 0, withCredentials: false, upload: XMLHttpRequestUpload, …}response: {data: 'Unauthorized - User not found', status: 401, statusText: '', headers: {…}, config: {…}, …}[[Prototype]]: Error The resource was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate as value and it is preloaded intentionally. The resource was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate as value and it is preloaded intentionally. The resource was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate as value and it is preloaded intentionally. The resource was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate as value and it is preloaded intentionally. The resource was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate as value and it is preloaded intentionally. The resource was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate as value and it is preloaded intentionally.

shihjay2 commented 1 year ago

The error indicates that in the users database, there is no user with your email that is set. Unless you changed the .env file AFTER you installed it the first time, this should technically not have happened. When you use the /start login, it automatically detects if the users database is empty and if so, it installs the first user email that is listed in your .env file. You'll need to inspect your database and find out what has populated your users database the first time to log in. Go to https://db.noshdemo.com/_utils/#login and authenticate using the credentials you saved in env (COUCHDB_USER, COUCHDB_PASSWORD). Go to the users (not _users) database and there should be at least 1 entry and open it and see what email value is set. That's the email to use and should not result in an error when you log in via Magic.

christian-geier commented 1 year ago

Hi thanks for the new instructions. I checked the link and the users DB is empty, so something did not work with, even after visiting the /start link. Can you recommend another work around ? Really interested in trying out the software.

image

shihjay2 commented 1 year ago

From Fauxton (screenshot you shared), delete the Users database. Then run /start again.

christian-geier commented 1 year ago

Hey thanks - deleted the users data base, went to noshdemo.com/start and got redirected to https://noshdemo.com/app/login . so far so good - unfortunately the users DB did not get restored as per Fauxton so login still does not work

shihjay2 commented 1 year ago

From Fauxton - delete all databases (including _users) and then run /start again.

christian-geier commented 1 year ago

OK done, I first got : "Bad gateway"; After a refresh of /start the login page forwards/loads fine In Fauxton, DB users is still empty

shihjay2 commented 1 year ago

I updated the code and there should be a new Docker Image. Make sure you have your system updated and use go to https://noshdemo.com/useraddtest and report the output.

christian-geier commented 1 year ago

I get alternating "Bad Gateway" and "404 Page not found"

shihjay2 commented 1 year ago

Can you confirm your Docker image ID for shihjay2/nosh3 is e1bb7396eb0a (latest)?

christian-geier commented 1 year ago

hmm I see multiple nosh3 entries, I believe I am running 2f8b4d0c9ea1 because it is tagged "latest" ?!

root@v7354:~# docker image ls REPOSITORY TAG IMAGE ID CREATED SIZE shihjay2/nosh3 latest 2f8b4d0c9ea1 5 hours ago 254MB shihjay2/nosh3 b668db2a2884 13 hours ago 254MB shihjay2/nosh3 e1bb7396eb0a 33 hours ago 254MB shihjay2/nosh3 db6b16206042 34 hours ago 254MB couchdb latest 585ea55610d2 37 hours ago 203MB shihjay2/nosh3 69d09ab94569 37 hours ago 254MB traefik latest a07d037aae0a 2 weeks ago 144MB shihjay2/nosh3 5f89232df03c 2 weeks ago 254MB traefik 75f6529f13bb 2 weeks ago 143MB couchdb 1b725f6b2513 3 weeks ago 203MB shihjay2/nosh3 37853027e771 4 weeks ago 254MB hello-world latest 9c7a54a9a43c 2 months ago 13.3kB containrrr/watchtower latest f847e1adb570 5 months ago 14.6MB

shihjay2 commented 1 year ago

That is correct (latest) - there has been a few new commits since my last post. Are you able to show the docker log for nosh3 when you make the call for for /useraddtest when you get the Bad Gateway error?

christian-geier commented 1 year ago

docker logs $(docker ps -aqf "name=^nosh$") -f listening on 4000

node:internal/process/promises:289 triggerUncaughtException(err, true / fromPromise /); ^ Error at new CustomPouchError (/usr/src/app/node_modules/pouchdb/lib/index.js:656:21) at createError (/usr/src/app/node_modules/pouchdb/lib/index.js:665:10) at invalidIdError (/usr/src/app/node_modules/pouchdb/lib/index.js:790:11) at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:1754:3) at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:290:21) at PouchDB. (/usr/src/app/node_modules/argsarray/index.js:14:18) at /usr/src/app/node_modules/pouchdb/lib/index.js:229:21 at new Promise () at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:216:19) at PouchDB.put (/usr/src/app/node_modules/argsarray/index.js:14:18) { status: 412, name: 'missing_id', message: '_id is required for puts', error: true }

Node.js v19.9.0 listening on 4000

node:internal/process/promises:289 triggerUncaughtException(err, true / fromPromise /); ^ Error at new CustomPouchError (/usr/src/app/node_modules/pouchdb/lib/index.js:656:21) at createError (/usr/src/app/node_modules/pouchdb/lib/index.js:665:10) at invalidIdError (/usr/src/app/node_modules/pouchdb/lib/index.js:790:11) at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:1754:3) at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:290:21) at PouchDB. (/usr/src/app/node_modules/argsarray/index.js:14:18) at /usr/src/app/node_modules/pouchdb/lib/index.js:229:21 at new Promise () at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:216:19) at PouchDB.put (/usr/src/app/node_modules/argsarray/index.js:14:18) { status: 412, name: 'missing_id', message: '_id is required for puts', error: true }

Node.js v19.9.0 listening on 4000 GET /start 302 104 - 177.476 ms GET /app/login 304 - - 7.609 ms GET /app/js/chunk-vendors.e31aeaa9.js 304 - - 1.115 ms GET /auth/config 304 - - 6.047 ms GET /app/img/icons/android-chrome-192x192.png 304 - - 0.926 ms GET /app/service-worker.js 304 - - 1.541 ms GET /app/workbox-5b385ed2.js 304 - - 0.907 ms

node:internal/process/promises:289 triggerUncaughtException(err, true / fromPromise /); ^ Error at new CustomPouchError (/usr/src/app/node_modules/pouchdb/lib/index.js:656:21) at createError (/usr/src/app/node_modules/pouchdb/lib/index.js:665:10) at invalidIdError (/usr/src/app/node_modules/pouchdb/lib/index.js:790:11) at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:1754:3) at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:290:21) at PouchDB. (/usr/src/app/node_modules/argsarray/index.js:14:18) at /usr/src/app/node_modules/pouchdb/lib/index.js:229:21 at new Promise () at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:216:19) at PouchDB.put (/usr/src/app/node_modules/argsarray/index.js:14:18) { status: 412, name: 'missing_id', message: '_id is required for puts', error: true }

Node.js v19.9.0 listening on 4000

node:internal/process/promises:289 triggerUncaughtException(err, true / fromPromise /); ^ Error at new CustomPouchError (/usr/src/app/node_modules/pouchdb/lib/index.js:656:21) at createError (/usr/src/app/node_modules/pouchdb/lib/index.js:665:10) at invalidIdError (/usr/src/app/node_modules/pouchdb/lib/index.js:790:11) at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:1754:3) at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:290:21) at PouchDB. (/usr/src/app/node_modules/argsarray/index.js:14:18) at /usr/src/app/node_modules/pouchdb/lib/index.js:229:21 at new Promise () at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:216:19) at PouchDB.put (/usr/src/app/node_modules/argsarray/index.js:14:18) { status: 412, name: 'missing_id', message: '_id is required for puts', error: true }

Node.js v19.9.0 listening on 4000 GET / 404 139 - 9.440 ms GET / 404 139 - 2.712 ms GET / 404 139 - 0.925 ms GET / 404 139 - 1.136 ms GET / 404 139 - 0.920 ms GET / 404 139 - 1.073 ms GET / 404 139 - 0.981 ms GET / 404 139 - 0.693 ms GET / 404 139 - 1.148 ms GET / 404 139 - 1.378 ms GET / 404 139 - 0.890 ms

node:internal/process/promises:289 triggerUncaughtException(err, true / fromPromise /); ^ Error at new CustomPouchError (/usr/src/app/node_modules/pouchdb/lib/index.js:656:21) at createError (/usr/src/app/node_modules/pouchdb/lib/index.js:665:10) at invalidIdError (/usr/src/app/node_modules/pouchdb/lib/index.js:790:11) at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:1754:3) at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:290:21) at PouchDB. (/usr/src/app/node_modules/argsarray/index.js:14:18) at /usr/src/app/node_modules/pouchdb/lib/index.js:229:21 at new Promise () at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:216:19) at PouchDB.put (/usr/src/app/node_modules/argsarray/index.js:14:18) { status: 412, name: 'missing_id', message: '_id is required for puts', error: true }

Node.js v19.9.0 listening on 4000 GET /addusertest 404 150 - 8.653 ms

shihjay2 commented 1 year ago

Your last call shows /addusertest - it should be /useraddtest; please share the log again after making this updated call.

christian-geier commented 1 year ago

Ah OK, I now used /useraddtest - sorry!

That's the output. The error message comes first, and it shows listening on 4000. When I call /useraddtest I get "bad gateway" and there is no more output

~/nosh# root@v7354:~/nosh# docker logs $(docker ps -aqf "name=^nosh$") -f listening on 4000

node:internal/process/promises:289 triggerUncaughtException(err, true / fromPromise /); ^ Error at new CustomPouchError (/usr/src/app/node_modules/pouchdb/lib/index.js:656:21) at createError (/usr/src/app/node_modules/pouchdb/lib/index.js:665:10) at invalidIdError (/usr/src/app/node_modules/pouchdb/lib/index.js:790:11) at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:1754:3) at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:290:21) at PouchDB. (/usr/src/app/node_modules/argsarray/index.js:14:18) at /usr/src/app/node_modules/pouchdb/lib/index.js:229:21 at new Promise () at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:216:19) at PouchDB.put (/usr/src/app/node_modules/argsarray/index.js:14:18) { status: 412, name: 'missing_id', message: '_id is required for puts', error: true }

Node.js v19.9.0 listening on 4000

node:internal/process/promises:289 triggerUncaughtException(err, true / fromPromise /); ^ Error at new CustomPouchError (/usr/src/app/node_modules/pouchdb/lib/index.js:656:21) at createError (/usr/src/app/node_modules/pouchdb/lib/index.js:665:10) at invalidIdError (/usr/src/app/node_modules/pouchdb/lib/index.js:790:11) at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:1754:3) at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:290:21) at PouchDB. (/usr/src/app/node_modules/argsarray/index.js:14:18) at /usr/src/app/node_modules/pouchdb/lib/index.js:229:21 at new Promise () at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:216:19) at PouchDB.put (/usr/src/app/node_modules/argsarray/index.js:14:18) { status: 412, name: 'missing_id', message: '_id is required for puts', error: true }

Node.js v19.9.0 listening on 4000 GET /start 302 104 - 177.476 ms GET /app/login 304 - - 7.609 ms GET /app/js/chunk-vendors.e31aeaa9.js 304 - - 1.115 ms GET /auth/config 304 - - 6.047 ms GET /app/img/icons/android-chrome-192x192.png 304 - - 0.926 ms GET /app/service-worker.js 304 - - 1.541 ms GET /app/workbox-5b385ed2.js 304 - - 0.907 ms

node:internal/process/promises:289 triggerUncaughtException(err, true / fromPromise /); ^ Error at new CustomPouchError (/usr/src/app/node_modules/pouchdb/lib/index.js:656:21) at createError (/usr/src/app/node_modules/pouchdb/lib/index.js:665:10) at invalidIdError (/usr/src/app/node_modules/pouchdb/lib/index.js:790:11) at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:1754:3) at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:290:21) at PouchDB. (/usr/src/app/node_modules/argsarray/index.js:14:18) at /usr/src/app/node_modules/pouchdb/lib/index.js:229:21 at new Promise () at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:216:19) at PouchDB.put (/usr/src/app/node_modules/argsarray/index.js:14:18) { status: 412, name: 'missing_id', message: '_id is required for puts', error: true }

Node.js v19.9.0 listening on 4000

node:internal/process/promises:289 triggerUncaughtException(err, true / fromPromise /); ^ Error at new CustomPouchError (/usr/src/app/node_modules/pouchdb/lib/index.js:656:21) at createError (/usr/src/app/node_modules/pouchdb/lib/index.js:665:10) at invalidIdError (/usr/src/app/node_modules/pouchdb/lib/index.js:790:11) at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:1754:3) at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:290:21) at PouchDB. (/usr/src/app/node_modules/argsarray/index.js:14:18) at /usr/src/app/node_modules/pouchdb/lib/index.js:229:21 at new Promise () at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:216:19) at PouchDB.put (/usr/src/app/node_modules/argsarray/index.js:14:18) { status: 412, name: 'missing_id', message: '_id is required for puts', error: true }

Node.js v19.9.0 listening on 4000 GET / 404 139 - 9.440 ms GET / 404 139 - 2.712 ms GET / 404 139 - 0.925 ms GET / 404 139 - 1.136 ms GET / 404 139 - 0.920 ms GET / 404 139 - 1.073 ms GET / 404 139 - 0.981 ms GET / 404 139 - 0.693 ms GET / 404 139 - 1.148 ms GET / 404 139 - 1.378 ms GET / 404 139 - 0.890 ms

node:internal/process/promises:289 triggerUncaughtException(err, true / fromPromise /); ^ Error at new CustomPouchError (/usr/src/app/node_modules/pouchdb/lib/index.js:656:21) at createError (/usr/src/app/node_modules/pouchdb/lib/index.js:665:10) at invalidIdError (/usr/src/app/node_modules/pouchdb/lib/index.js:790:11) at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:1754:3) at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:290:21) at PouchDB. (/usr/src/app/node_modules/argsarray/index.js:14:18) at /usr/src/app/node_modules/pouchdb/lib/index.js:229:21 at new Promise () at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:216:19) at PouchDB.put (/usr/src/app/node_modules/argsarray/index.js:14:18) { status: 412, name: 'missing_id', message: '_id is required for puts', error: true }

Node.js v19.9.0 listening on 4000 GET /addusertest 404 150 - 8.653 ms

node:internal/process/promises:289 triggerUncaughtException(err, true / fromPromise /); ^ Error at new CustomPouchError (/usr/src/app/node_modules/pouchdb/lib/index.js:656:21) at createError (/usr/src/app/node_modules/pouchdb/lib/index.js:665:10) at invalidIdError (/usr/src/app/node_modules/pouchdb/lib/index.js:790:11) at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:1754:3) at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:290:21) at PouchDB. (/usr/src/app/node_modules/argsarray/index.js:14:18) at /usr/src/app/node_modules/pouchdb/lib/index.js:229:21 at new Promise () at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:216:19) at PouchDB.put (/usr/src/app/node_modules/argsarray/index.js:14:18) { status: 412, name: 'missing_id', message: '_id is required for puts', error: true }

Node.js v19.9.0 listening on 4000

node:internal/process/promises:289 triggerUncaughtException(err, true / fromPromise /); ^ Error at new CustomPouchError (/usr/src/app/node_modules/pouchdb/lib/index.js:656:21) at createError (/usr/src/app/node_modules/pouchdb/lib/index.js:665:10) at invalidIdError (/usr/src/app/node_modules/pouchdb/lib/index.js:790:11) at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:1754:3) at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:290:21) at PouchDB. (/usr/src/app/node_modules/argsarray/index.js:14:18) at /usr/src/app/node_modules/pouchdb/lib/index.js:229:21 at new Promise () at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:216:19) at PouchDB.put (/usr/src/app/node_modules/argsarray/index.js:14:18) { status: 412, name: 'missing_id', message: '_id is required for puts', error: true }

Node.js v19.9.0 listening on 4000

node:internal/process/promises:289 triggerUncaughtException(err, true / fromPromise /); ^ Error at new CustomPouchError (/usr/src/app/node_modules/pouchdb/lib/index.js:656:21) at createError (/usr/src/app/node_modules/pouchdb/lib/index.js:665:10) at invalidIdError (/usr/src/app/node_modules/pouchdb/lib/index.js:790:11) at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:1754:3) at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:290:21) at PouchDB. (/usr/src/app/node_modules/argsarray/index.js:14:18) at /usr/src/app/node_modules/pouchdb/lib/index.js:229:21 at new Promise () at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:216:19) at PouchDB.put (/usr/src/app/node_modules/argsarray/index.js:14:18) { status: 412, name: 'missing_id', message: '_id is required for puts', error: true }

Node.js v19.9.0 listening on 4000

node:internal/process/promises:289 triggerUncaughtException(err, true / fromPromise /); ^ Error at new CustomPouchError (/usr/src/app/node_modules/pouchdb/lib/index.js:656:21) at createError (/usr/src/app/node_modules/pouchdb/lib/index.js:665:10) at invalidIdError (/usr/src/app/node_modules/pouchdb/lib/index.js:790:11) at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:1754:3) at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:290:21) at PouchDB. (/usr/src/app/node_modules/argsarray/index.js:14:18) at /usr/src/app/node_modules/pouchdb/lib/index.js:229:21 at new Promise () at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:216:19) at PouchDB.put (/usr/src/app/node_modules/argsarray/index.js:14:18) { status: 412, name: 'missing_id', message: '_id is required for puts', error: true }

Node.js v19.9.0 listening on 4000

node:internal/process/promises:289 triggerUncaughtException(err, true / fromPromise /); ^ Error at new CustomPouchError (/usr/src/app/node_modules/pouchdb/lib/index.js:656:21) at createError (/usr/src/app/node_modules/pouchdb/lib/index.js:665:10) at invalidIdError (/usr/src/app/node_modules/pouchdb/lib/index.js:790:11) at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:1754:3) at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:290:21) at PouchDB. (/usr/src/app/node_modules/argsarray/index.js:14:18) at /usr/src/app/node_modules/pouchdb/lib/index.js:229:21 at new Promise () at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:216:19) at PouchDB.put (/usr/src/app/node_modules/argsarray/index.js:14:18) { status: 412, name: 'missing_id', message: '_id is required for puts', error: true }

Node.js v19.9.0 listening on 4000

node:internal/process/promises:289 triggerUncaughtException(err, true / fromPromise /); ^ Error at new CustomPouchError (/usr/src/app/node_modules/pouchdb/lib/index.js:656:21) at createError (/usr/src/app/node_modules/pouchdb/lib/index.js:665:10) at invalidIdError (/usr/src/app/node_modules/pouchdb/lib/index.js:790:11) at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:1754:3) at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:290:21) at PouchDB. (/usr/src/app/node_modules/argsarray/index.js:14:18) at /usr/src/app/node_modules/pouchdb/lib/index.js:229:21 at new Promise () at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:216:19) at PouchDB.put (/usr/src/app/node_modules/argsarray/index.js:14:18) { status: 412, name: 'missing_id', message: '_id is required for puts', error: true }

Node.js v19.9.0 listening on 4000

node:internal/process/promises:289 triggerUncaughtException(err, true / fromPromise /); ^ Error at new CustomPouchError (/usr/src/app/node_modules/pouchdb/lib/index.js:656:21) at createError (/usr/src/app/node_modules/pouchdb/lib/index.js:665:10) at invalidIdError (/usr/src/app/node_modules/pouchdb/lib/index.js:790:11) at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:1754:3) at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:290:21) at PouchDB. (/usr/src/app/node_modules/argsarray/index.js:14:18) at /usr/src/app/node_modules/pouchdb/lib/index.js:229:21 at new Promise () at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:216:19) at PouchDB.put (/usr/src/app/node_modules/argsarray/index.js:14:18) { status: 412, name: 'missing_id', message: '_id is required for puts', error: true }

Node.js v19.9.0 listening on 4000

node:internal/process/promises:289 triggerUncaughtException(err, true / fromPromise /); ^ Error at new CustomPouchError (/usr/src/app/node_modules/pouchdb/lib/index.js:656:21) at createError (/usr/src/app/node_modules/pouchdb/lib/index.js:665:10) at invalidIdError (/usr/src/app/node_modules/pouchdb/lib/index.js:790:11) at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:1754:3) at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:290:21) at PouchDB. (/usr/src/app/node_modules/argsarray/index.js:14:18) at /usr/src/app/node_modules/pouchdb/lib/index.js:229:21 at new Promise () at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:216:19) at PouchDB.put (/usr/src/app/node_modules/argsarray/index.js:14:18) { status: 412, name: 'missing_id', message: '_id is required for puts', error: true }

Node.js v19.9.0 listening on 4000

node:internal/process/promises:289 triggerUncaughtException(err, true / fromPromise /); ^ Error at new CustomPouchError (/usr/src/app/node_modules/pouchdb/lib/index.js:656:21) at createError (/usr/src/app/node_modules/pouchdb/lib/index.js:665:10) at invalidIdError (/usr/src/app/node_modules/pouchdb/lib/index.js:790:11) at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:1754:3) at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:290:21) at PouchDB. (/usr/src/app/node_modules/argsarray/index.js:14:18) at /usr/src/app/node_modules/pouchdb/lib/index.js:229:21 at new Promise () at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:216:19) at PouchDB.put (/usr/src/app/node_modules/argsarray/index.js:14:18) { status: 412, name: 'missing_id', message: '_id is required for puts', error: true }

Node.js v19.9.0 listening on 4000

node:internal/process/promises:289 triggerUncaughtException(err, true / fromPromise /); ^ Error at new CustomPouchError (/usr/src/app/node_modules/pouchdb/lib/index.js:656:21) at createError (/usr/src/app/node_modules/pouchdb/lib/index.js:665:10) at invalidIdError (/usr/src/app/node_modules/pouchdb/lib/index.js:790:11) at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:1754:3) at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:290:21) at PouchDB. (/usr/src/app/node_modules/argsarray/index.js:14:18) at /usr/src/app/node_modules/pouchdb/lib/index.js:229:21 at new Promise () at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:216:19) at PouchDB.put (/usr/src/app/node_modules/argsarray/index.js:14:18) { status: 412, name: 'missing_id', message: '_id is required for puts', error: true }

Node.js v19.9.0 listening on 4000

node:internal/process/promises:289 triggerUncaughtException(err, true / fromPromise /); ^ Error at new CustomPouchError (/usr/src/app/node_modules/pouchdb/lib/index.js:656:21) at createError (/usr/src/app/node_modules/pouchdb/lib/index.js:665:10) at invalidIdError (/usr/src/app/node_modules/pouchdb/lib/index.js:790:11) at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:1754:3) at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:290:21) at PouchDB. (/usr/src/app/node_modules/argsarray/index.js:14:18) at /usr/src/app/node_modules/pouchdb/lib/index.js:229:21 at new Promise () at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:216:19) at PouchDB.put (/usr/src/app/node_modules/argsarray/index.js:14:18) { status: 412, name: 'missing_id', message: '_id is required for puts', error: true }

Node.js v19.9.0

shihjay2 commented 1 year ago

In the root folder where docker-compose.yml is located, shut down the docker compose containers with docker compose down. Then wipe the entire couchdb configs and databases to completely start over. rm -rf dbconfig; rm -rf dbdata. Then do docker compose up -d. Then go back to the browser and run https://noshdemo.com/start and report back.

christian-geier commented 1 year ago

done... new output:

docker logs $(docker ps -aqf "name=^nosh$") -f listening on 4000 PouchDB sync complete for DB: activities

node:internal/process/promises:289 triggerUncaughtException(err, true / fromPromise /); ^ Error at new CustomPouchError (/usr/src/app/node_modules/pouchdb/lib/index.js:656:21) at createError (/usr/src/app/node_modules/pouchdb/lib/index.js:665:10) at invalidIdError (/usr/src/app/node_modules/pouchdb/lib/index.js:790:11) at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:1754:3) at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:290:21) at PouchDB. (/usr/src/app/node_modules/argsarray/index.js:14:18) at /usr/src/app/node_modules/pouchdb/lib/index.js:229:21 at new Promise () at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:216:19) at PouchDB.put (/usr/src/app/node_modules/argsarray/index.js:14:18) { status: 412, name: 'missing_id', message: '_id is required for puts', error: true }

Node.js v19.9.0 listening on 4000 GET /start 302 104 - 186.033 ms GET /app/login 304 - - 13.912 ms GET /app/js/chunk-vendors.e31aeaa9.js 304 - - 1.270 ms GET /auth/config 304 - - 5.749 ms GET /app/img/icons/android-chrome-192x192.png 304 - - 2.407 ms GET /app/img/icons/favicon.svg 200 818 - 5.965 ms GET /app/service-worker.js 304 - - 1.744 ms GET /app/workbox-5b385ed2.js 304 - - 0.926 ms GET / 404 139 - 6.065 ms HEAD /start 302 52 - 49.246 ms HEAD /app/login 200 1551 - 2.421 ms

node:internal/process/promises:289 triggerUncaughtException(err, true / fromPromise /); ^ Error at new CustomPouchError (/usr/src/app/node_modules/pouchdb/lib/index.js:656:21) at createError (/usr/src/app/node_modules/pouchdb/lib/index.js:665:10) at invalidIdError (/usr/src/app/node_modules/pouchdb/lib/index.js:790:11) at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:1754:3) at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:290:21) at PouchDB. (/usr/src/app/node_modules/argsarray/index.js:14:18) at /usr/src/app/node_modules/pouchdb/lib/index.js:229:21 at new Promise () at PouchDB. (/usr/src/app/node_modules/pouchdb/lib/index.js:216:19) at PouchDB.put (/usr/src/app/node_modules/argsarray/index.js:14:18) { status: 412, name: 'missing_id', message: '_id is required for puts', error: true }

Node.js v19.9.0

shihjay2 commented 1 year ago

I found the problem and has been fixed in commit 967bd49. Await for the docker image to be rebuilt (~2 hours) and just in case - repeat the database deletion steps above and report back.

christian-geier commented 1 year ago

there's progress.

Magic login still gives trouble, now returns:

Error connecting to Magic! Please try again later!

christian-geier commented 1 year ago

I again checked the console, it shows Error: Unable to refresh user session. Please log in using the magic link flow to enable session persistence.

That's the full console output:

registerServiceWorker.js:14 Service worker has been registered. registerServiceWorker.js:20 New content is downloading. auth.magic.link/v1/session/refresh:1 Failed to load resource: the server responded with a status of 400 () app.chunk~store.f40a23723e1568aefcb1.js:1 could not authenticate via cookie Error: Unable to refresh user session. Please log in using the magic link flow to enable session persistence. at c (app.chunk~fad58de7366495db4650cfefac2fcd61.5d019ec66b2743aa5d65.js:1:701335) at Object.errorTransform (app.chunk~services.a1905df287aca27e0fda.js:1:13731) at app.chunk~fad58de7366495db4650cfefac2fcd61.5d019ec66b2743aa5d65.js:1:703498 (anonymous) @ app.chunk~store.f40a23723e1568aefcb1.js:1 runtime-core.esm-bundler.js:226 Error: Magic RPC Error: [-32603] Internal error: User denied account access. at index.mjs:5:3484 h @ runtime-core.esm-bundler.js:226 The resource <URL> was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriateasvalue and it is preloaded intentionally. The resource <URL> was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriateasvalue and it is preloaded intentionally. The resource <URL> was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriateasvalue and it is preloaded intentionally. The resource <URL> was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriateasvalue and it is preloaded intentionally. The resource <URL> was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriateasvalue and it is preloaded intentionally. The resource <URL> was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriateasvalue and it is preloaded intentionally. The resource <URL> was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriateasvalue and it is preloaded intentionally. The resource <URL> was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriateasvalue and it is preloaded intentionally. The resource <URL> was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriateasvalue and it is preloaded intentionally. registerServiceWorker.js:17 Content has been cached for offline use. registerServiceWorker.js:8 App is being served from cache by a service worker. For more details, visit https://goo.gl/AFskqB app.chunk~vendor~fad58de7366495db4650cfefac2fcd61.0dffee05b1912d2db1f4.js:2 Cross-Origin Read Blocking (CORB) blocked cross-origin response https://browser-http-intake.logs.datadoghq.com/v1/input/pub6e83b9e7b97e8037f6e1ab083d997dde?ddsource=browser&ddtags=sdk_version%3A3.10.0%2Cenv%3Aprod%2Cservice%3Aauth-prod with MIME type application/json. See https://www.chromestatus.com/feature/5629709824032768 for more details. e.send @ app.chunk~vendor~fad58de7366495db4650cfefac2fcd61.0dffee05b1912d2db1f4.js:2 e.flush @ app.chunk~vendor~fad58de7366495db4650cfefac2fcd61.0dffee05b1912d2db1f4.js:2 (anonymous) @ app.chunk~vendor~fad58de7366495db4650cfefac2fcd61.0dffee05b1912d2db1f4.js:2 Ze @ app.chunk~vendor~fad58de7366495db4650cfefac2fcd61.0dffee05b1912d2db1f4.js:2 (anonymous) @ app.chunk~vendor~fad58de7366495db4650cfefac2fcd61.0dffee05b1912d2db1f4.js:2

christian-geier commented 1 year ago

Hi, after setting up a completely new Magic account/API key I can get to the following screen:

image

I cannot get past it, but I believe this issue is fixed so will open a separate thread