Skip to content

Don't configure the root logger when importing image_puller - #471

Merged
mr-c merged 1 commit into
common-workflow-language:mainfrom
mvdbeek:image-puller-no-basicconfig
Sep 26, 2026
Merged

mr-c merged 1 commit into
common-workflow-language:mainfrom
mvdbeek:image-puller-no-basicconfig

Conversation

@mvdbeek

@mvdbeek mvdbeek commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

cwl_utils.image_puller calls logging.basicConfig(level=logging.INFO) at import time. cwltool 3.3.20260925135507 now imports it from cwltool/singularity.py, so any program that imports cwltool has its root logger set to INFO with a stderr handler. INFO messages from unrelated libraries then go to stderr.

In Galaxy this broke history exports. The export job imports cwltool indirectly, gcsfs then logs an INFO line at import, and Galaxy treats unexpected stderr from that job as a failure (galaxyproject/galaxy#23736).

This moves the basicConfig call into docker-extract's main(), so the CLI still prints the puller's INFO messages, and adds a test that importing cwl_utils.image_puller leaves the root logger unconfigured. I checked that the test fails without the change.

cwl_utils.image_puller called logging.basicConfig(level=logging.INFO) at
import time. Since cwltool 3.3 imports it from cwltool.singularity, any
program that imports cwltool gets its root logger set to INFO with a stderr
handler, so INFO messages from unrelated libraries start going to stderr.

Configure logging in docker-extract's main() instead, so the CLI output is
unchanged.
mvdbeek added a commit to galaxybot/galaxy that referenced this pull request Sep 26, 2026
cwl_utils.image_puller calls logging.basicConfig(level=logging.INFO) at
import time, and cwltool 3.3 imports it. Any Galaxy process that imports
cwltool then logs INFO messages to stderr, which fails jobs whose tools
treat stderr as an error, such as history export to a URI (gcsfs logs an
INFO line when imported). With cwl-utils 0.44 excluded the resolver falls
back to cwltool 3.2.20260720092025 and cwl-utils 0.43, as on dev.

Upstream fix: common-workflow-language/cwl-utils#471
@codecov

codecov Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.71429% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 38.86%. Comparing base (a8e06ee) to head (c0d0da9).

Files with missing lines Patch % Lines
src/cwl_utils/docker_extract.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #471   +/-   ##
=======================================
  Coverage   38.85%   38.86%           
=======================================
  Files          51       51           
  Lines       34718    34724    +6     
  Branches     8824     8824           
=======================================
+ Hits        13489    13494    +5     
- Misses      18331    18332    +1     
  Partials     2898     2898           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mr-c
mr-c merged commit bebcdf4 into common-workflow-language:main Sep 26, 2026
14 checks passed
@mr-c

mr-c commented Sep 26, 2026

Copy link
Copy Markdown
Member

Thank you @mvdbeek !

@mvdbeek

mvdbeek commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the quick merge!

@mvdbeek
mvdbeek deleted the image-puller-no-basicconfig branch September 26, 2026 13:48
mvdbeek added a commit to galaxybot/galaxy that referenced this pull request Sep 26, 2026
cwl-utils 0.45 includes the fix for the import-time logging.basicConfig()
(common-workflow-language/cwl-utils#471), so the cwltool update can go
ahead. The cwl-utils!=0.44 exclusion stays.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants