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.comMONGODB_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:
Star
Discord
online
Get dedicated engineering support directly from the Payload team.