I have a node app. Trying to connect to a git repo via the app.
It works locally. It also works when I docker build and run it via container locally.
But when I deploy it, getting the following error.
Error: Cloning into '/opt/app-root/dist/temp_repo'... fatal: unable to access 'https://github.companyDomain.com/owner/repo-name.git/': CONNECT tunnel failed, response 404
CONNECT - HTTP/1.1" 404 NR route_not_found - "-" 0 0 0 - "-" "git/2.38.5" "583aa8-0b75-47a5-a90e-3f0bc2aab696" "github.companyDomain.com:443
Why?
My code in the main index.js file.
import simpleGit from 'simple-git';
const url = `https://validUserName:[email protected]/owner/repo-name.git`;
export const clone = async () => {
await simpleGit().clone(url, '/opt/app-root/dist/temp_repo', {
'--branch': 'main',
'--single-branch': null,
'--depth': '1',
});
};
await clone();
P.S: When deployed, I have set firewall rules for github.companyDomain.com TLS 443 and HTTPS 80.
Deployment is to a company owned internal server which I don't fully control.
Is not like AWS or Azure. Is self managed Kubernetes based if this info matters.
Your Kubernetes cluster is utilizing Istio, and the error message
404 NR route_not_foundmeans Istio is unable to find a route or a matching filter chain for the downstream connection when your application is attempting to clone the git repository. The404 NRerror code stands for "No Route" and indicates that a routing problem exists within the Istio configuration. Here's how you might address or investigate this issue further:Make sure there is a
VirtualServiceandDestinationRuleconfiguration forgithub.companyDomain.comor ensure that the external traffic togithub.companyDomain.comis properly handled in your Istio configuration.If there is a
VirtualServiceconfiguration forgithub.companyDomain.com, make sure the routes are correctly defined and that they point to the correctDestinationRuleand subsets, if applicable.Create a
ServiceEntryto allow traffic togithub.companyDomain.com. AServiceEntryinforms Istio how to handle external traffic.See also this discussion which involves adding a match section for the path in question to the first
VirtualServiceso that it routes to the correct service. Similarly, in your case, check the routing configurations in your Istio setup correctly match the paths and hosts your application is trying to access might help resolve the 404 NR route_not_found error.