Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't create Thread: Operation not permitted #182

Closed
mockdeep opened this issue Jul 26, 2023 · 2 comments
Closed

can't create Thread: Operation not permitted #182

mockdeep opened this issue Jul 26, 2023 · 2 comments

Comments

@mockdeep
Copy link

Orb version

2.2.0

What happened

We're seeing an issue building a Ruby Dockerfile on CircleCI. I can build the image locally, but when we try to use the Docker orb to build the image, we see errors complaining about "Operation not permitted":

Step 10/23 : RUN gem install bundler:$BUNDLER_VERSION && bundle install
 ---> Running in 24cab0098d8b
ERROR:  While executing gem ... (ThreadError)
    can't create Thread: Operation not permitted
	/usr/local/lib/ruby/3.2.0/timeout.rb:101:in `initialize'
	/usr/local/lib/ruby/3.2.0/timeout.rb:101:in `new'
	/usr/local/lib/ruby/3.2.0/timeout.rb:101:in `create_timeout_thread'
	/usr/local/lib/ruby/3.2.0/timeout.rb:134:in `block in ensure_timeout_thread_created'
	/usr/local/lib/ruby/3.2.0/timeout.rb:132:in `synchronize'
	/usr/local/lib/ruby/3.2.0/timeout.rb:132:in `ensure_timeout_thread_created'
	/usr/local/lib/ruby/3.2.0/timeout.rb:181:in `timeout'
	/usr/local/lib/ruby/3.2.0/net/http.rb:1269:in `connect'
	/usr/local/lib/ruby/3.2.0/net/http.rb:1248:in `do_start'
	/usr/local/lib/ruby/3.2.0/net/http.rb:1243:in `start'
	/usr/local/lib/ruby/3.2.0/rubygems/request/http_pool.rb:43:in `setup_connection'
	/usr/local/lib/ruby/3.2.0/rubygems/request/https_pool.rb:7:in `setup_connection'
	/usr/local/lib/ruby/3.2.0/rubygems/request/http_pool.rb:39:in `make_connection'
	/usr/local/lib/ruby/3.2.0/rubygems/request/http_pool.rb:20:in `checkout'
	/usr/local/lib/ruby/3.2.0/rubygems/request.rb:129:in `connection_for'
	/usr/local/lib/ruby/3.2.0/rubygems/request.rb:188:in `perform_request'
	/usr/local/lib/ruby/3.2.0/rubygems/request.rb:154:in `fetch'
	/usr/local/lib/ruby/3.2.0/rubygems/remote_fetcher.rb:309:in `request'
	/usr/local/lib/ruby/3.2.0/rubygems/remote_fetcher.rb:209:in `fetch_http'
	/usr/local/lib/ruby/3.2.0/rubygems/remote_fetcher.rb:248:in `fetch_path'
	/usr/local/lib/ruby/3.2.0/rubygems/source.rb:88:in `dependency_resolver_set'
	/usr/local/lib/ruby/3.2.0/rubygems/resolver/best_set.rb:23:in `block in pick_sets'
	/usr/local/lib/ruby/3.2.0/rubygems/source_list.rb:94:in `each'
	/usr/local/lib/ruby/3.2.0/rubygems/source_list.rb:94:in `each_source'
	/usr/local/lib/ruby/3.2.0/rubygems/resolver/best_set.rb:22:in `pick_sets'
	/usr/local/lib/ruby/3.2.0/rubygems/resolver/best_set.rb:28:in `find_all'
	/usr/local/lib/ruby/3.2.0/rubygems/resolver/installer_set.rb:170:in `find_all'
	/usr/local/lib/ruby/3.2.0/rubygems/resolver/installer_set.rb:61:in `add_always_install'
	/usr/local/lib/ruby/3.2.0/rubygems/dependency_installer.rb:322:in `resolve_dependencies'
	/usr/local/lib/ruby/3.2.0/rubygems/commands/install_command.rb:205:in `install_gem'
	/usr/local/lib/ruby/3.2.0/rubygems/commands/install_command.rb:230:in `block in install_gems'
	/usr/local/lib/ruby/3.2.0/rubygems/commands/install_command.rb:223:in `each'
	/usr/local/lib/ruby/3.2.0/rubygems/commands/install_command.rb:223:in `install_gems'
	/usr/local/lib/ruby/3.2.0/rubygems/commands/install_command.rb:169:in `execute'
	/usr/local/lib/ruby/3.2.0/rubygems/command.rb:327:in `invoke_with_build_args'
	/usr/local/lib/ruby/3.2.0/rubygems/command_manager.rb:252:in `invoke_command'
	/usr/local/lib/ruby/3.2.0/rubygems/command_manager.rb:192:in `process_args'
	/usr/local/lib/ruby/3.2.0/rubygems/command_manager.rb:150:in `run'
	/usr/local/lib/ruby/3.2.0/rubygems/gem_runner.rb:51:in `run'
	/usr/local/bin/gem:10:in `<main>'
The command '/bin/bash -c gem install bundler:$BUNDLER_VERSION && bundle install' returned a non-zero code: 1

Exited with code exit status 1

CircleCI received exit code 1

Expected behavior

The Docker image should build and publish from CircleCI.

@malpinder
Copy link

I'm also seeing this error, in the exact same way - failing on bundle install. I'm on ruby 3.2.2 and bundler 2.4.18. Interestingly, I have another project on ruby 3.0.6 that is set up identically but doesn't fail like this - a bit of spelunking pointed me to this change in the timeout library that makes it reuse a thread rather than creating a new one, though that might be unrelated.

malpinder added a commit to collegeofteaching/base-ruby that referenced this issue Aug 7, 2023
CircleCI-Public/docker-orb#182

Docker and circleCI don't play with with ruby >=
3.1, for some reason.
@EricRibeiro
Copy link
Contributor

Hey folks, thanks for opening this issue.

I believe this issue isn't inherent to the orb. I found a few mentions of similar issues related to this, and it seems like a fix was implemented.

Nevertheless I tried replicating it by creating a simple project using v3.2.2 but could not see the error: https://app.circleci.com/pipelines/github/EricRibeiro/ruby-docker-example/8/workflows/b33730e7-4d10-4377-811d-97afb2cf3dc8/jobs/11.

Please let me know if there is anything I am missing. In the meantime, I'll close this issue, but I'm happy to re-open it if you provide more information or confirm the issue is on CircleCI's side.

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

No branches or pull requests

3 participants