You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Attempted to initialize RESTObject with a non-dictionary value: <Response [200]>
This likely indicates an incorrect or malformed server response.
Expected Behavior
Since I can successfully interact with the same server programmatically from Python (i.e. I am getting a valid server JSON response) I suspect this is a problem of the CLI.
The server response is 200 this typically indicates OK. So it will have sent some payload back.
I expect identical behaviour of package and CLI.
Actual Behavior
Specifications
python-gitlab version: 3.15.0
API version you are using (v3/v4): v4
Gitlab server version (or gitlab.com): 14.9.5
Reacted by andresmanzanaressouthworks and Stavros Ntentos
@stdedos in your case, you seem to have the wrong base URL. /-/profile/personal_access_tokens/api/v4/user in the initial GET call looks suspicious as that's a web endpoint and not for the v4 API. did you make sure it's just set to https://gitlab.com or left out (maybe there's an environment variable is interfering)?
And I suspect the same thing might be happening in the original post, but our CLI might not be the most informative with the malformed response error (e.g. if it's returning some HTML because the user hits the web browser URL instead of the API endpoints).
a bit more strict it what it accepts? And/or check early if "it's valid" or not?
If you mean the URLs, I don't think we can as people can serve GitLab at arbitrary endpoints (e.g. https://company.com/my-gitlab, https://company.com/apps/-/gitlab/ - silly example but you get the idea). So it's hard to tell whether a URL is a GitLab base URL or a project URL (which shouldn't be used).
We check if we can authenticate using gl.auth() which I think should already fail here. I'd say best to expose a bit more info if the returned object is a Response perhaps?
This issue was marked stale because it has been open 60 days with no activity. Please remove the stale label or comment on this issue. Otherwise, it will be closed in 15 days.
Activity
stdedos commentedon Mar 6, 2024
Apologies for the "necrobump" and the @nejch -bump 😅
I am having the same issue in
gitlab --version 4.4.0.idk why would I need to sign_in 😕
private_token = helper:does return the correct tokenAny ideas?
nejch commentedon Mar 6, 2024
@stdedos in your case, you seem to have the wrong base URL.
/-/profile/personal_access_tokens/api/v4/userin the initial GET call looks suspicious as that's a web endpoint and not for the v4 API. did you make sure it's just set tohttps://gitlab.comor left out (maybe there's an environment variable is interfering)?nejch commentedon Mar 6, 2024
And I suspect the same thing might be happening in the original post, but our CLI might not be the most informative with the malformed response error (e.g. if it's returning some HTML because the user hits the web browser URL instead of the API endpoints).
stdedos commentedon Mar 6, 2024
Yeap 😕 That's it
Can you please make
gitlab.Gitlaba bit more strict it what it accepts? And/or check early if "it's valid" or not?... do you want a new issue, or re-use this one?
nejch commentedon Mar 6, 2024
If you mean the URLs, I don't think we can as people can serve GitLab at arbitrary endpoints (e.g. https://company.com/my-gitlab, https://company.com/apps/-/gitlab/ - silly example but you get the idea). So it's hard to tell whether a URL is a GitLab base URL or a project URL (which shouldn't be used).
We check if we can authenticate using
gl.auth()which I think should already fail here. I'd say best to expose a bit more info if the returned object is aResponseperhaps?stdedos commentedon Mar 6, 2024
Yeah, I have done that mistake multiple times 😅
Sure, but - I have no idea what. That obviously looks wrong:
but, in the context of
"it's not exactly wrong".
chore(ci): specify name of "stale" label
chore(ci): specify name of "stale" label
github-actions commentedon Jul 28, 2024
This issue was closed because it has been marked stale for 15 days with no activity. If this issue is still valid, please re-open.
stdedos commentedon Jul 28, 2024
@nejch Do you think that this should be re-opened? TIA
github-actions commentedon Sep 27, 2024
This issue was marked stale because it has been open 60 days with no activity. Please remove the stale label or comment on this issue. Otherwise, it will be closed in 15 days.
github-actions commentedon Oct 13, 2024
This issue was closed because it has been marked stale for 15 days with no activity. If this issue is still valid, please re-open.
stdedos commentedon Oct 13, 2024
#NotStale? 😕