- Notifications
You must be signed in to change notification settings - Fork673
Getting an SSL error when querying project#3212
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Hi!
I can't figure out if it's something I've done somehow, but I don't think I touched anything. |
BetaWas this translation helpful?Give feedback.
All reactions
I found out the root cause by printing the server responses from within the urllib library:
UserWarning: The base URL in the server response differs from the user-provided base URL (https://gitlab.example.com:443 -> https://gitlab.example.com:80)
So it was a configuration issue, I had this in mycompose.yaml
:
services: gitlab: image: gitlab/gitlab-ee:18.0.1-ee.0 container_name: gitlab restart: always hostname: '$HOSTNAME' environment: GITLAB_OMNIBUS_CONFIG: | # Add any other gitlab.rb configuration here, each on its own line # I'm including only relevant configs here external_url 'http://$HOSTNAME' ports: - '$SSH_PORT:22' …
Replies: 2 comments 4 replies
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
I pasted this into Google Gemini The requests.exceptions.SSLError: HTTPSConnectionPool(host='gitlab.example.com', port=80): Max retries exceeded with url: ... (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1028)'))) error indicates a problem with the SSL/TLS handshake between your Python program and the GitLab server.
Correct URL for HTTPS
|
BetaWas this translation helpful?Give feedback.
All reactions
👍 1
-
Oh sorry, I noticed I disclosed the URL there, my oversight, could you edit your comment and delete the original from the revisions, please? Thanks for the suggestions BTW, I'll try to go through that and see what I can get |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
I found out the root cause by printing the server responses from within the urllib library:
So it was a configuration issue, I had this in my
I had the external URL as HTTP, consequently GitLab assumed port 80 and that's what it would respond with when asking for paginated endpoints ( I put this in the variable, note the difference in GITLAB_OMNIBUS_CONFIG:| # Add any other gitlab.rb configuration here, each on its own line # I'm including only relevant configs here external_url 'https://$HOSTNAME' nginx['listen_port'] = 80 nginx['listen_https'] =false And now it's all working correctly, GitLab responds with HTTPS endpoints. Note: the reason why it worked until it didn't is that my requests initially didn't need pagination until I had added enough labels to the project, so it only used the URL I would provide, which also led me to believe there weren't problems with my input (which is true, the issue lies in the server response) when I tried to perform a manual connection as suggested by@JohnVillalovos to troubleshoot |
BetaWas this translation helpful?Give feedback.
All reactions
-
Glad you solved it! Just for any future readers: The |
BetaWas this translation helpful?Give feedback.
All reactions
❤️ 1
-
Oh, I see, I thought it came from the server, how can I get these warnings always? When I enabled the python-gitlab debug mode this didn't come up on its own, I had to print it explicitly |
BetaWas this translation helpful?Give feedback.
All reactions
-
@quazar-omega the UserWarning is always raised by python-gitlab when it detects this, but maybe it wasn't surfaced by your app - not sure about the context or what your code looks like. But if you executed that code directly in a script/snippet, you'd see the UserWarning logged to stderr directly. |
BetaWas this translation helpful?Give feedback.