Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proxy Error When Publishing #870

Closed
DanielJerrehian opened this issue Jan 2, 2024 · 3 comments
Closed

Proxy Error When Publishing #870

DanielJerrehian opened this issue Jan 2, 2024 · 3 comments
Labels
connection-issues Issues trying to talk with a Confluence instance

Comments

@DanielJerrehian
Copy link

DanielJerrehian commented Jan 2, 2024

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

@jdknight
Copy link
Member

@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 jdknight added the connection-issues Issues trying to talk with a Confluence instance label Feb 3, 2024
@gsemet
Copy link

gsemet commented Feb 15, 2024

Remove the http from your proxy settings.

@jdknight
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
connection-issues Issues trying to talk with a Confluence instance
Projects
None yet
Development

No branches or pull requests

3 participants