umbertoghio / self-hosted-expo-updates-server

MIT License
136 stars 17 forks source link

Issue with docker in production #26

Open Dag0n opened 1 month ago

Dag0n commented 1 month ago
2024/09/23 07:00PM 30 pid=1 hostname=1a06abc60acb msg=Feathers application started on http://localhost:3000
2024/09/23 07:00PM 30 pid=1 hostname=1a06abc60acb msg=Env: production DB: mongodb://expo@myRegularUserPassw:self_hosted_expo_updates_server_db:27017/expo
2024/09/23 07:00PM 50 pid=1 hostname=1a06abc60acb msg=API - Unhandled Rejection at: Promise 
2024/09/23 07:00PM 50 pid=1 hostname=1a06abc60acb msg=API - Unhandled Rejection at: Promise 
2024/09/23 07:00PM 50 pid=1 hostname=1a06abc60acb msg=API - Unhandled Rejection at: Promise 
2024/09/23 07:00PM 50 pid=1 hostname=1a06abc60acb msg=API - Unhandled Rejection at: Promise 
2024/09/23 07:00PM 50 pid=1 hostname=1a06abc60acb msg=TypeError: Cannot read properties of undefined (reading 'find')
    at Object._find (/home/node/server/node_modules/feathers-mongodb/lib/index.js:123:26)
    at callMethod (/home/node/server/node_modules/@feathersjs/adapter-commons/lib/service.js:13:22)
    at Object.find (/home/node/server/node_modules/@feathersjs/adapter-commons/lib/service.js:63:16)
    at /home/node/server/node_modules/@feathersjs/feathers/lib/hooks/index.js:57:33
    at new Promise (<anonymous>)
    at /home/node/server/node_modules/@feathersjs/feathers/lib/hooks/index.js:54:27
    at async createAdminIfMissing (/home/node/server/src/index.js:18:19)
2024/09/23 07:00PM 50 pid=1 hostname=1a06abc60acb msg=API - Unhandled Rejection at: Promise 

Using defaults or amending the docker-compose.yaml I get the above error.

umbertoghio commented 1 month ago

Hello, seems that the error happens because the db is empty and it is trying to create the admin user, have you managed to go pasti it? maybe a permission issue for the DB

Chuazz commented 1 month ago

same issue with you :v

Chuazz commented 1 month ago

my dockerr-compose.yml

`version: '3.7' services: api: image: ghcr.io/umbertoghio/self-hosted-expo-updates-server-api:latest container_name: api restart: always depends_on:

volumes: mongo_data:`

and my init.js

`/ eslint-disable no-undef /

let db = connect("mongodb://admin:myPRODUCTIONPassword@localhost:27017/admin");

db = db.getSiblingDB("expo");

db.createUser({ user: "expo", pwd: "myRegularUserPassw", roles: [ { role: "readWrite", db: "expo", }, ], });`