Skip to content

[BUG] docker generate fails with uid > 100000 #990

Open

Description

@bamapookie

🐛 Bug Report:

Describe the bug

When running the generator and using podman with a large uid (over 100000), launching the OCI container fails with an error.

[[v1] src/openapi/api-docs.json] Error: OCI runtime error: crun: setresuid to xxxxxxxxxx: Invalid argument

openapi-generator-cli is running the OCI container with command line option --user xxxxxxxxxx:yyyyy and this is outside the range of available namespace users.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Log in with a user with uid > 100000.
  2. Configure openapitools.json with "useDocker": true
  3. Run npx openapi-generator-cli generate
  4. See error

Expected behavior

Generator runs and generates files

Screenshots

If applicable, add screenshots to help explain your problem.

Operation System (please complete the following information):

  • OS: RHEL 9
  • Version 9.6

Package System (please complete the following information):

  • Node 22.12.0
  • NPM 10.9.0
  • openapi-generator-cli 2.23.1
  • Open API Generator 6.6.0

Additional Comments

I am using rootless podman with the docker command mapped to podman behind the scenes.

Activity

  1. changed the title [-][BUG][/-] [+][BUG] docker generate fails with uid > 100000[/+] on Sep 9, 2025
  2. bamapookie commented on Sep 9, 2025

    @bamapookie
    Author

    Also, I did find this: podman-container-tools/podman#21293

    It indicates that an additional parameter might be needed: --userns=keep-id:uid=xxxxxxxxxx,gid=yyyyy

  3. bamapookie commented on Sep 9, 2025

    @bamapookie
    Author

    Updated to include that I am using rootless podman.

  4. bamapookie commented on Sep 9, 2025

    @bamapookie
    Author

    I added 10000 < a.uid ? `--userns-keep-id:uid${a.uid}=,gid=${a.gid}` : "" , to the docker command line in main.js, and that worked.

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions