Environments Git configuration on Azure Kubernetes keeps returning 404 error

Describe the problem/error/question

Hi folks, new to n8n and we have upgraded to the Business Plan and are self-hosting with Azure Kubernetes. Has anyone had issues with using the Environments feature and connecting to a Git repository through Bitbucket?
I’ve been going in circles with the configuration and keep getting a 404 error. I have even run the cloud shell on my Kubernetes instance and successfully cloned the repository to my n8n storage, so it doesn’t seem like an Azure issue, or could it still be?

What is the error message (if any)?

Please share your workflow


Share the output returned by the last node

Information on your n8n setup

  • n8n version: 2.10.3
  • Database (default: SQLite): PostgreSQL
  • n8n EXECUTIONS_PROCESS setting (default: own, main): N/A
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Azure Kubernetes
  • Operating system: N/A

Hi @chenglo, welcome to the n8n community!
I faced a similar issue recently and, after some deep diving into the logs, I realized that the root cause usually involves file permissions or subtle details in the repository URL. In my case, adjusting the persistent volume permissions to UID 1000 on Azure Kubernetes was what solved it, as it’s easy to overlook the “nobody user” restriction during the initial deploy. If the permissions are correct, I would recommend checking if you are using a Personal Access Token (PAT) instead of the default password, since a simple authentication mismatch can often trigger those frustrating 404 errors.

If none of that works @chenglo , could you share a bit more detail so we can try to narrow this down? It would be really helpful to know if you’re on Bitbucket Cloud or the On-premise Server version, since the URL paths can change quite a bit between them. Also, if you can, paste a snippet of your deployment YAML here, just remember to redact any passwords, so I can check how your n8n environment variables are set up. Oh, and one last thing: keep an eye on your container logs via kubectl logs and let me know exactly which full URL is showing up right before that 404 error hits.

Oh my gosh, thanks Tamy! Thanks for cluing me in! Such a small little thing but it was totally the persistent volume permission to UID 1000. Here’s the small adjustment I made to the n8n-deployment.yaml (all I did was add the recursive -R):

command: ["sh", "-c", "chown -R 1000:1000 /data"]

Then I added this underneath it:

securityContext:
   runAsUser: 0

That’s all it took to get the Git repository to connect. Big thank for you hint! :slight_smile:

1 Like

Glad to help :slight_smile:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.