René's URL Explorer Experiment


Title: Fetching variable with environment scope raises 409 complaining about multiple variables with same key · Issue #3202 · python-gitlab/python-gitlab · GitHub

Open Graph Title: Fetching variable with environment scope raises 409 complaining about multiple variables with same key · Issue #3202 · python-gitlab/python-gitlab

X Title: Fetching variable with environment scope raises 409 complaining about multiple variables with same key · Issue #3202 · python-gitlab/python-gitlab

Description: Description of the problem, including code/CLI snippet When attempting to fetch a project variable with a specific environment_scope using the python-gitlab API (v5.6.0) against GitLab server (17.6.5-ee), the documented and intuitive app...

Open Graph Description: Description of the problem, including code/CLI snippet When attempting to fetch a project variable with a specific environment_scope using the python-gitlab API (v5.6.0) against GitLab server (17.6...

X Description: Description of the problem, including code/CLI snippet When attempting to fetch a project variable with a specific environment_scope using the python-gitlab API (v5.6.0) against GitLab server (17.6...

Opengraph URL: https://github.com/python-gitlab/python-gitlab/issues/3202

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Fetching variable with environment scope raises 409 complaining about multiple variables with same key","articleBody":"\n\n## Description of the problem, including code/CLI snippet\n\nWhen attempting to fetch a project variable with a specific `environment_scope` using the python-gitlab API (v5.6.0) against GitLab server (17.6.5-ee), the documented and intuitive approaches do not work. Specifically, neither passing `environment_scope` nor `filter_environment_scope` as arguments to `ProjectVariableManager.get()` resolves the error `409: There are multiple variables with provided parameters. Please use 'filter[environment_scope]'` even when only two variables exist with unique environment scopes.\n\nExample (all fail with 409 error):\n\n```\nsrc.variables.get(\"PUBLISH_TIMEOUT\", \"*\")\nsrc.variables.get(\"PUBLISH_TIMEOUT\", environment_scope=\"*\")\nsrc.variables.get(\"PUBLISH_TIMEOUT\", filter_environment_scope=\"*\")\n```\n\nThe only way to successfully fetch the correct variable is by using the undocumented `query_parameters` argument, as discovered by reading the source code:\n\n```\nsrc.variables.get(\np.key,\nquery_parameters={\"filter[environment_scope]\": p.environment_scope}\n)\n```\n\nThis workaround is not documented and the error message does not guide the user to this solution. The documentation and exception message should be updated to clarify the correct usage.\n\n## Expected Behavior\n\nPassing either `environment_scope` or `filter_environment_scope` as an argument to `ProjectVariableManager.get()` should allow selection of the correct variable when multiple variables share the same key but have different environment scopes, as described in the GitLab API documentation. The library should transparently handle the filter parameter, or at least document the correct usage.\n\n## Actual Behavior\n\nPassing `environment_scope` or `filter_environment_scope` as arguments to `get()` results in a 409 error from the API:\n\n```\ngitlab.exceptions.GitlabGetError: 409: There are multiple variables with provided parameters. Please use 'filter[environment_scope]'\n```\n\nThe only way to successfully retrieve the variable is by passing the filter as a `query_parameters` dictionary, which is not documented (at least, not in the places where the documentation would be of use):\n\n```\nsrc.variables.get(\np.key,\nquery_parameters={\"filter[environment_scope]\": p.environment_scope}\n)\n```\n\n## Specifications\n\n- python-gitlab version: 5.6.0\n- Gitlab server version (or gitlab.com): v17.6.5-ee\n","author":{"url":"https://github.com/elucify","@type":"Person","name":"elucify"},"datePublished":"2025-05-21T18:47:14.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/3202/python-gitlab/issues/3202"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:bbc338a5-550c-dd4f-dc30-2bf933bdbd05
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idD3EC:684B7:1CBCBD6:24C5E38:6975D495
html-safe-nonce47e6efd76c68ad7125f5c3ae58694bf11f6ddc50ea6abf7dc63f542fd27c305b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEM0VDOjY4NEI3OjFDQkNCRDY6MjRDNUUzODo2OTc1RDQ5NSIsInZpc2l0b3JfaWQiOiIyNDQ0MTg5NzEzMTI3MDY3MDkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacbab98e974d66208ea1c9d77bf821b24bbf24ac1ebdfca810eb35d50bde5814e2
hovercard-subject-tagissue:3081128439
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python-gitlab/python-gitlab/3202/issue_layout
twitter:imagehttps://opengraph.githubassets.com/2afaace2677c11aa51838ab18cbffc67c0f44f7834608d8024a3ad7fd69beae2/python-gitlab/python-gitlab/issues/3202
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/2afaace2677c11aa51838ab18cbffc67c0f44f7834608d8024a3ad7fd69beae2/python-gitlab/python-gitlab/issues/3202
og:image:altDescription of the problem, including code/CLI snippet When attempting to fetch a project variable with a specific environment_scope using the python-gitlab API (v5.6.0) against GitLab server (17.6...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameelucify
hostnamegithub.com
expected-hostnamegithub.com
None2bce766e7450b03e00b2fc5badd417927ce33a860e78cda3e4ecb9bbd1374cc6
turbo-cache-controlno-preview
go-importgithub.com/python-gitlab/python-gitlab git https://github.com/python-gitlab/python-gitlab.git
octolytics-dimension-user_id28886265
octolytics-dimension-user_loginpython-gitlab
octolytics-dimension-repository_id8077625
octolytics-dimension-repository_nwopython-gitlab/python-gitlab
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id8077625
octolytics-dimension-repository_network_root_nwopython-gitlab/python-gitlab
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasefcca2b8ef702b5f7f91427a6e920fa44446fe312
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/python-gitlab/python-gitlab/issues/3202#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython-gitlab%2Fpython-gitlab%2Fissues%2F3202
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython-gitlab%2Fpython-gitlab%2Fissues%2F3202
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python-gitlab%2Fpython-gitlab
Reloadhttps://patch-diff.githubusercontent.com/python-gitlab/python-gitlab/issues/3202
Reloadhttps://patch-diff.githubusercontent.com/python-gitlab/python-gitlab/issues/3202
Reloadhttps://patch-diff.githubusercontent.com/python-gitlab/python-gitlab/issues/3202
python-gitlab https://patch-diff.githubusercontent.com/python-gitlab
python-gitlabhttps://patch-diff.githubusercontent.com/python-gitlab/python-gitlab
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2Fpython-gitlab%2Fpython-gitlab
Fork 675 https://patch-diff.githubusercontent.com/login?return_to=%2Fpython-gitlab%2Fpython-gitlab
Star 2.4k https://patch-diff.githubusercontent.com/login?return_to=%2Fpython-gitlab%2Fpython-gitlab
Code https://patch-diff.githubusercontent.com/python-gitlab/python-gitlab
Issues 26 https://patch-diff.githubusercontent.com/python-gitlab/python-gitlab/issues
Pull requests 11 https://patch-diff.githubusercontent.com/python-gitlab/python-gitlab/pulls
Discussions https://patch-diff.githubusercontent.com/python-gitlab/python-gitlab/discussions
Actions https://patch-diff.githubusercontent.com/python-gitlab/python-gitlab/actions
Projects 0 https://patch-diff.githubusercontent.com/python-gitlab/python-gitlab/projects
Security 0 https://patch-diff.githubusercontent.com/python-gitlab/python-gitlab/security
Insights https://patch-diff.githubusercontent.com/python-gitlab/python-gitlab/pulse
Code https://patch-diff.githubusercontent.com/python-gitlab/python-gitlab
Issues https://patch-diff.githubusercontent.com/python-gitlab/python-gitlab/issues
Pull requests https://patch-diff.githubusercontent.com/python-gitlab/python-gitlab/pulls
Discussions https://patch-diff.githubusercontent.com/python-gitlab/python-gitlab/discussions
Actions https://patch-diff.githubusercontent.com/python-gitlab/python-gitlab/actions
Projects https://patch-diff.githubusercontent.com/python-gitlab/python-gitlab/projects
Security https://patch-diff.githubusercontent.com/python-gitlab/python-gitlab/security
Insights https://patch-diff.githubusercontent.com/python-gitlab/python-gitlab/pulse
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/python-gitlab/python-gitlab/issues/3202
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/python-gitlab/python-gitlab/issues/3202
Fetching variable with environment scope raises 409 complaining about multiple variables with same keyhttps://patch-diff.githubusercontent.com/python-gitlab/python-gitlab/issues/3202#top
https://github.com/elucify
https://github.com/elucify
elucifyhttps://github.com/elucify
on May 21, 2025https://github.com/python-gitlab/python-gitlab/issues/3202#issue-3081128439
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.