confluencebuilder icon indicating copy to clipboard operation
confluencebuilder copied to clipboard

Proxy Error When Publishing

Open DanielJerrehian opened this issue 1 year ago • 2 comments

I am attempting to publish Sphinx documentation on an intranet Confluence page which has a server URL similar to the following: https://DomainName.CompanyName.TopLevelDomain

When I run the command python -m sphinx -b confluence . /confluence -E -a in the terminal, I am prompted to enter my username and password, then receive a 403 proxy error:

sphinxcontrib.confluencebuilder error:

---
Invalid Confluence URL detected

An issue has been detected when trying to communicate with the
configured Confluence instance. Ensure the instance is running and
inspect that the configured Confluence URL is valid:

   https://DomainName.CompanyName.TopLevelDomain

(details: HTTPSConnectionPool(host='https://DomainName.CompanyName.TopLevelDomain', port=443): Max retries exceeded with url: /rest/api/space?spaceKey=<MySpaceKey>&limit=1 (Caused by ProxyError('Unable to connect to proxy', OSError('Tunnel connection failed: 403 Forbidden'))))
---

How do you configure a proxy when running publishing in the terminal?


Edit: I tried adding confluence_proxy = 'http://my-proxy:port/' to my conf.py file and got the same error

DanielJerrehian avatar Jan 02 '24 11:01 DanielJerrehian

@DanielJerrehian, sorry, I'm not sure off hand why you may be experience these connection issues.

Mind generating a python -m sphinxcontrib.confluencebuilder report output?

Assuming you can access Confluence via your browser, you could try to see if you can query the REST API from your browser as well. For example, venturing to a page like https://DomainName.CompanyName.TopLevelDomain/rest/api/space (assuming that's the proper endpoint for your Confluence instances), and you should see a JSON-like response in the browser.

If you do, next possible check would be to try the same request in the terminal/shell you may be using. For example, invoking one of these calls and seeing a JSON-like response:

curl https://DomainName.CompanyName.TopLevelDomain/rest/api/space
 or
wget -qO- https://DomainName.CompanyName.TopLevelDomain/rest/api/space
 or
Invoke-WebRequest -Uri https://DomainName.CompanyName.TopLevelDomain/rest/api/space

And if those work, lastly, you can tree a publish attempt using the confluence_publish_debug = True option set. This may print some helpful debug messages to the standard output.

jdknight avatar Jan 29 '24 00:01 jdknight

Remove the http from your proxy settings.

gsemet avatar Feb 15 '24 07:02 gsemet

Remove the http from your proxy settings.

This can be valid in select scenarios. This would depend on the version of urllib3 installed (used by Requests). Newer versions of the library expect a leading scheme, where older versions do not. For users who may be experiencing proxy-related issues, it is recommended to update their Requests/urllib3 to a more recent version (if possible).


It has been three months since this initial request has been made, but no new information has been discussed related to OPs user experience. It is assumed that the issue has been resolved, or has been dropped. With that in mind, this issue will be closed. Feel free to create a new issue if needed in the future.

jdknight avatar Mar 30 '24 01:03 jdknight