Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions lib/galaxy/managers/file_source_instances.py
Original file line number Diff line number Diff line change
Expand Up @@ -642,18 +642,24 @@ def template_server_configuration(
template = catalog.find_template_by(template_id, template_version)
oauth2_configuration = get_oauth2_config_or_none(template)
oauth2_scope = None
oauth2_client_pair_obj = None
if oauth2_configuration is not None:
environment = prepare_environment_from_root(template.environment, self._app_vault, self._app_config)
user_details = user.config_template_details()
oauth2_client_pair_obj, oauth2_scope = read_oauth2_info_from_configuration(
template.configuration, user_details, environment
)
try:
oauth2_client_pair_obj, oauth2_scope = read_oauth2_info_from_configuration(
template.configuration, user_details, environment
)
except Exception:
log.warning(
Copy link
Member

@mvdbeek mvdbeek Mar 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the wording implies unix env vars ? I think that's just the environment section from the template (https://github.com/galaxyproject/usegalaxy-playbook/blob/main/env/common/files/galaxy/config/file_source_template_google_drive.yml#L9), maybe this needs rewording ? Did you test the fix ? And why does it only affect google drive ?

"Failed to resolve OAuth2 client credentials for template %s - "
"required environment variables may not be set",
template_id,
)
# most configuration definitions won't include this, the default for the
# plugin type is the fallback and the typical case here
if oauth2_scope is None:
oauth2_scope = oauth2_configuration.scope
else:
oauth2_client_pair_obj = None
return TemplateServerConfiguration(
oauth2_client_pair=oauth2_client_pair_obj,
oauth2_configuration=oauth2_configuration,
Expand Down
Loading