Skip to content

Error of quantms-rescoring process with AWS - #621

Merged
ypriverol merged 3 commits into
bigbio:devfrom
ypriverol:dev
Dec 4, 2025
Merged

ypriverol merged 3 commits into
bigbio:devfrom
ypriverol:dev

Conversation

@ypriverol

@ypriverol ypriverol commented Dec 3, 2025 •

Copy link
Copy Markdown
Contributor

User description

PR checklist

  • This comment contains a description of changes (with reason).
  • If you've fixed a bug or added code that should be tested, add tests!
  • If you've added a new tool - have you followed the pipeline conventions in the contribution docs
  • If necessary, also make a PR on the bigbio/quantms branch on the nf-core/test-datasets repository.
  • Make sure your code lints (nf-core pipelines lint).
  • Ensure the test suite passes (nextflow run . -profile test,docker --outdir <OUTDIR>).
  • Check for unexpected warnings in debug mode (nextflow run . -profile debug,test,docker --outdir <OUTDIR>).
  • Usage Documentation in docs/usage.md is updated.
  • Output Documentation in docs/output.md is updated.
  • CHANGELOG.md is updated.
  • README.md is updated (including new tool citations and authors/contributors).

PR Type

Bug fix


Description

  • Removed problematic Docker user emulation settings causing AWS compatibility issues

  • Simplified container options configuration for ms2rescore process

  • Eliminates unnecessary volume mounts and environment variable handling


Diagram Walkthrough

flowchart LR
  A["MSRESCORE_FEATURES process"] -- "removed containerOptions" --> B["Simplified container configuration"]
  B -- "AWS compatible" --> C["Improved compatibility"]
Loading

File Walkthrough

Relevant files
Bug fix
main.nf
Remove Docker user emulation settings for AWS                       

modules/local/utils/msrescore_features/main.nf

  • Removed containerOptions variable assignment that applied
    Docker-specific user emulation settings
  • Eliminated volume mounts for /etc/passwd, /etc/shadow, and /etc/group
  • Removed HOME environment variable and user ID mapping that caused AWS
    execution failures
+0/-3     

@coderabbitai

coderabbitai Bot commented Dec 3, 2025 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@qodo-code-review

qodo-code-review Bot commented Dec 3, 2025 •

Copy link
Copy Markdown
Contributor

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
⚪
🎫 No ticket provided
  • Create ticket/issue
Codebase Duplication Compliance
⚪
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

⚪
Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status:
No logging context: The added process configuration does not add or modify any audit logging for critical
actions, and it is unclear whether the underlying process logs necessary audit details.

Referred Code
process MSRESCORE_FEATURES {
    tag "$meta.mzml_id"
    label 'process_high'

    container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
        'oras://ghcr.io/bigbio/quantms-rescoring-sif:0.0.12' :
        'ghcr.io/bigbio/quantms-rescoring:0.0.12' }"

    input:
    tuple val(meta), path(idxml), path(mzml)

    output:
    tuple val(meta), path("*ms2rescore.idXML") , emit: idxml

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status:
Missing error handling: The process definition lacks explicit error handling or retry/timeout adjustments related
to the removed containerOptions which may affect execution edge cases on AWS.

Referred Code
process MSRESCORE_FEATURES {
    tag "$meta.mzml_id"
    label 'process_high'

    container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
        'oras://ghcr.io/bigbio/quantms-rescoring-sif:0.0.12' :
        'ghcr.io/bigbio/quantms-rescoring:0.0.12' }"

    input:
    tuple val(meta), path(idxml), path(mzml)

    output:
    tuple val(meta), path("*ms2rescore.idXML") , emit: idxml

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status:
Input validation unclear: The added lines define process inputs and outputs but do not introduce validation or
sanitation for external files, leaving security posture dependent on unseen code.

Referred Code
input:
tuple val(meta), path(idxml), path(mzml)

output:
tuple val(meta), path("*ms2rescore.idXML") , emit: idxml

Learn more about managing compliance generic rules or creating your own custom rules

  • Update
Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@qodo-code-review

qodo-code-review Bot commented Dec 3, 2025 •

Copy link
Copy Markdown
Contributor

PR Code Suggestions ✨

No code suggestions found for the PR.

@ypriverol

Copy link
Copy Markdown
Contributor Author

@jonasscheid @daichengxin We are testing AWS, and we are getting the following message:

Caused by:
  The user value contains invalid characters. Enter a value that matches the pattern ^([a-z0-9_][a-z0-9_-]{0,30})$


Command executed:

  rescoring msrescore2feature \

From the nf-core channels, I got that other users face when setting up containerOptions. We don't have that variable in the other steps.

@jonasscheid have you tested this before in your pipeline in AWS?

@daichengxin

Copy link
Copy Markdown
Collaborator

LGTM

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses an AWS compatibility issue by removing Docker-specific user emulation settings from the MSRESCORE_FEATURES process. The problematic containerOptions configuration included volume mounts for system files (/etc/passwd, /etc/shadow, /etc/group) and user ID mapping that caused execution failures on AWS infrastructure.

Key Changes:

  • Removed containerOptions variable assignment that applied Docker-specific user emulation settings
  • Eliminates volume mounts and HOME environment variable configuration that were incompatible with AWS execution

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jonasscheid

Copy link
Copy Markdown
Contributor

I know people ran it on aws, but should not matter since this is only relevant for docker profile and not aws profile. Did you specify aws profile?

@ypriverol

Copy link
Copy Markdown
Contributor Author

Yes we specify it, could be that the aws profile is not updated?

@jpfeuffer jpfeuffer left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why was this needed anyway? Are the options specified in the global docker profile not enough??

Have you tried specifying -profile aws,docker ?

I think it is better if we remove those lines as much as possible to not interfere with User Setups.

@ypriverol

Copy link
Copy Markdown
Contributor Author

I actually agree, Im removing them now, and if they are needed they can be provided by configs.

@ypriverol
ypriverol merged commit aebb87d into bigbio:dev Dec 4, 2025
@jonasscheid

Copy link
Copy Markdown
Contributor

Why was this needed anyway? Are the options specified in the global docker profile not enough??

nextflow removed the userEmulation flag from docker and gave more fine-grained possibility to define your own user settings for docker via containerOptions. That caused perimission errors almost two years ago, maybe they have been resolved now. See Discussion here. Sure remove it, but keep this issue in mind if you run into it again

@jpfeuffer

Copy link
Copy Markdown
Collaborator

Nextflow configuration is beyond salvation anyway. The whole docker user permissions thing falls apart as soon as you have non-root docker Installations. Including the docker profile in nf-core.
The fact that you cannot have dynamic/additive profiles makes it impossible to create defaults for more complex things like this anyway.
I gave up long ago to try to provide default configurations for anything but parameters in the tools.

@jonasscheid

Copy link
Copy Markdown
Contributor

The whole docker user permissions thing falls apart as soon as you have non-root docker Installations. Including the docker profile in nf-core.

Doesn't the default'-u $(id -u):$(id -g)' fix the non-root docker issue? 🤔

The fact that you cannot have dynamic/additive profiles makes it impossible to create defaults for more complex things like this anyway.

I'm not super into this, but you can specify all kinds of docker flags via containerOptions for each process right? So it's dynamic in the sense that the user can change it, no? 🤔

@jpfeuffer

Copy link
Copy Markdown
Collaborator

The default is for docker Installations where you are root inside the container but want to pass the user id from outside to be able to write into mounted folders owned by the user.
This does not work if the docker installation does not allow to be root inside the container.
I want all the other containerOptions except this one in the above case.
For arm I want an additional "-platform arm64". Have fun specifying profiles for 2**n combinations for everything.

@jpfeuffer

Copy link
Copy Markdown
Collaborator

This is because nextflow cannot have profiles/configurations that depend on each other/are dynamic/additive.
This is the biggest flaw ever in nextflow in my opinion.

@jonasscheid

Copy link
Copy Markdown
Contributor

Valid points 👍🏼 You should bring this up in nextflow / nf-core Forum/Slack or Github!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

5 participants