Error: Fetching user failed

default discord avatar
jayjaysmooth11 months ago

Hi,


we're deploying the CMS in a K8s Cluster. When attempting to open the site / to login, the following error appears:


Fetching user failed: NetworkError when attempting to fetch resource.


The following env vars are set:


PAYLOAD_SEED_ADMIN_PASSWORD: ${{ secrets.PAYLOAD_SEED_ADMIN_PASSWORD }}


PAYLOAD_SEED_USER_PASSWORD: ${{ secrets.PAYLOAD_SEED_USER_PASSWORD }}


PAYLOAD_SECRET: ${{ secrets.PAYLOAD_SECRET }}


PUBLIC_PAYLOAD_URL:

https://cms-dev.mydomain.com

MONGODB_URI: mongodb://website-dev-mongo.website-dev.svc.cluster.local:27017



An ingress to the public URL is deployed and is reachable. Connection to mongoDB works fine. The login URL is

https://cms-dev.mydomain.com/admin

. When the image is run on a local machine, logging in works fine.


Any help or ideas would be much appreciated 🙂



SOLUTION:


CMS still tried to connect to localhost URL in production. There was an env file in source code, which was setting the URL. The correct usage of .dockerignore file in our pipeline solved it. Since we're using different Dockerfiles in different paths, that's the correct way to set the dockerignore:


https://stackoverflow.com/questions/40904409/how-to-specify-different-dockerignore-files-for-different-builds-in-the-same-pr
    Star on GitHub

    Star

    Chat on Discord

    Discord

    online

    Can't find what you're looking for?

    Get help straight from the Payload team with an Enterprise License.