'HTTP_PROXIES' not working for Git repository sync
See original GitHub issueEnvironment
- Python version: 3.8.10
- Nautobot version: 1.3.4
- OS: Ubuntu 20.04
- ‘HTTP_PROXIES’ for usage of proxy server configured
Steps to Reproduce
Follow the standard installation process for an Ubuntu 20.04 server:
- https://nautobot.readthedocs.io/en/stable/installation/ubuntu/
- https://nautobot.readthedocs.io/en/stable/installation/nautobot/
- https://nautobot.readthedocs.io/en/stable/installation/services/
- https://nautobot.readthedocs.io/en/stable/installation/http-server/
- Open the browser and check that Nautobot is working --> Yes, works!
- Install the ‘nautobot-welcome-wizard’ --> Has been loaded
- Click ‘Plugins’ --> ‘Welcome Wizard’ --> Action ‘Import’ for ‘Device Types’ --> Site loaded correctly, but after refreshing the ‘Import Device Types’ table is still empty
- Click ‘Extensibility’ --> ‘Git Repositories’ --> ‘Devicetype-library’ --> ‘Synchronization Status’
- After some time I will get the following two (timeout) errors. I did manual line breaks for easier reading:
Cmd('git') failed due to: exit code(128)
cmdline: git clone -v https://github.com/netbox-community/devicetype-library.git /opt/nautobot/git/devicetype_library
stderr: 'Cloning into '/opt/nautobot/git/devicetype_library'...
fatal: unable to access 'https://github.com/netbox-community/devicetype-library.git/':
Failed to connect to github.com port 443: Connection timed out '
Error while refreshing Devicetype-library:
Cmd('git') failed due to: exit code(128)
cmdline: git clone -v https://github.com/netbox-community/devicetype-library.git /opt/nautobot/git/devicetype_library
stderr: 'Cloning into '/opt/nautobot/git/devicetype_library'...
fatal: unable to access 'https://github.com/netbox-community/devicetype-library.git/':
Failed to connect to github.com port 443: Connection timed out '
Configuration
I configured my HTTP proxy in the file nautobot_config.py
as follows, but replaced the real IP addresses:
# HTTP proxies Nautobot should use when sending outbound HTTP requests (e.g. for webhooks).
HTTP_PROXIES = {
'http': 'http://192.0.2.1:3128',
'https': 'http://192.0.2.1:3128',
}
Expected Behavior
I can see traffic flowing over the proxy server.
Observed Behavior
I used TCP dump on the proxy server and there we’re no packets incoming from the Nautobot server. I also checked with tcpdump on the Nautobot server and can say, that it’s sending it’s HTTP(S) traffic to the default gateway, so no proxy has been used.
I also checked directly on the Linux console and I can clone repositories from Github. I also saw the traffic on the proxy server. --> Proy configuration in Linux is working
Issue Analytics
- State:
- Created a year ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Source Sync Issues
Difficulties syncing the source code (proxy issues). Symptom: repo init or repo sync fails with HTTP errors, typically 403 or 500. Cause: There ......
Read more >1993917 – Syncing repositories with https proxy set ends with ...
Description of problem: Syncing repositories with https proxy set ends with warning Katello::Errors::Pulp3 Error Only http proxies are supported ...
Read more >Working with HTTP Proxies | OpenShift Container Platform 3.11
If your Git repository can only be accessed using a proxy, you can define the proxy to use in the source section of...
Read more >How do I pull from a Git repository through an HTTP proxy?
CleverCoder, on Windows, you need to specify %HTTP_PROXY%, not $HTTP_PROXY (unless you're running Cygwin, of course). I will edit my answer to work...
Read more >Syncing code from GitHub - Checkly
Check our checklyhq.com repository to see this approach in practice. Working with external NPM package dependencies. The Checkly runtime does not support ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@glennmatthews I created a pull request 😃
Thanks a lot, it’s working now! 😃 Run these commands as user
nautobot
:It would be good if the git proxy configuration for Nautobot gets documented. That’s the current HTTP_PROXIES documentation, but no word about the git commands. Do you think it’s a good idea to do that?