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

bundler: bundle: not found error occurs when running renovate using Docker #4016

Closed
ikesyo opened this issue Jul 2, 2019 · 12 comments
Closed

Comments

@ikesyo
Copy link
Collaborator

ikesyo commented Jul 2, 2019

What Renovate type are you using?
Renovate CLI (Docker)

Describe the bug
When running Renovate CLI using Docker for a repository which have Gemfile, bundle: not found error occurs.

Did you see anything helpful in debug logs?

 INFO: Running bundler via global bundler (repository=redacted, dependencies=cocoapods, branch=renovate/cocoapods-1.x)
 WARN: Failed to generate Gemfile.lock (unknown error) (repository=redacted, dependencies=cocoapods, branch=renovate/cocoapods-1.x)
       "err": {
         "name": "ChildProcessError",
         "code": 127,
         "childProcess": {},
         "stdout": "",
         "stderr": "/bin/sh: 1: bundle: not found\n",
         "message": "Command failed: bundle lock --update cocoapods\n/bin/sh: 1: bundle: not found\n `bundle lock --update cocoapods` (exited with error code 127)",
         "stack": "ChildProcessError: Command failed: bundle lock --update cocoapods\n/bin/sh: 1: bundle: not found\n `bundle lock --update cocoapods` (exited with error code 127)\n    at callback (/usr/src/app/node_modules/child-process-promise/lib/index.js:33:27)\n    at ChildProcess.exithandler (child_process.js:301:5)\n    at ChildProcess.emit (events.js:198:13)\n    at maybeClose (internal/child_process.js:982:16)\n    at Socket.stream.socket.on (internal/child_process.js:389:11)\n    at Socket.emit (events.js:198:13)\n    at Pipe._handle.close (net.js:606:12)"
       }

To Reproduce
Steps to reproduce the behavior:

  1. Create repository with a Gemfile whose contents are outdated
  2. Running Renovate CLI with Docker for that repository

Expected behavior
Successfully finishing the execution.

Screenshots

Additional context
Looks like the Dockerfile does not set up Ruby and bundler so that will be the cause.

@ikesyo
Copy link
Collaborator Author

ikesyo commented Jul 2, 2019

This is a bit related to #3860, so if I use --binary-source=docker (Docker in Docker) that may work, but I've not confirmed. It will be a workaround.

@rarkins
Copy link
Collaborator

rarkins commented Jul 2, 2019

Bundler will only work with binarySource=docker because of the importance of running the exact Ruby and Bundler version the project requires. Ie if we added one specific version to the Dockerfile then it would be “wrong” for a large proportion of users.

Bundler is the first package manager to need this, and it’s still so we’re a bit lacking in docs, but we plan to roll it out for all binaries and then publish a much smaller Renovate default image that pulls the other images as needed.

@ikesyo
Copy link
Collaborator Author

ikesyo commented Jul 2, 2019

Okay now I understand the situation, thanks for the clarification! It would be great

  • If we could add the note for Bundler (Gemfile)
  • If we could add a (temporary) fix for the situation: adding another condition whether the process is running in Docker here
    if (config.binarySource === 'docker') {

@rarkins
Copy link
Collaborator

rarkins commented Jul 2, 2019

I don’t understand your second point. Could you describe in more detail what you mean?

I should have said that you can run Bundler using globals, but for that to work with the Docker distribution you’ll need to add Ruby/bundler to the image yourself.

@ikesyo
Copy link
Collaborator Author

ikesyo commented Jul 2, 2019

I don’t understand your second point. Could you describe in more detail what you mean?

What I want is that Renovate CLI would run Bundler using Docker even if binarySource=docker is not specified when Renovate CLI is executed by Docker (running in a container). I just want the renovate/renovate image supports Bundler out-of-the-box without specifying the option.

but for that to work with the Docker distribution you’ll need to add Ruby/bundler to the image yourself.

I see that you won't support the case, so please feel free to close this.

@rarkins
Copy link
Collaborator

rarkins commented Jul 2, 2019

Actually it’s not “docker in docker” so that’s not possible unless you map in the Docker socket to Renovate

@ikesyo
Copy link
Collaborator Author

ikesyo commented Jul 2, 2019

#3153, #3222 👀

@ikesyo ikesyo closed this as completed Jul 5, 2019
@shushugah
Copy link

@ikesyo, My team has the exact same issue. I am unclear what you did to fix this. I can open a new issue if necessary. Here is my error, when running it locally

WARN: Failed to generate Gemfile.lock (unknown error) (repository=payment/test-gems, dependencies=rails, branch=PAY-1729-Renovaterails-6-x)
       "err": {
         "killed": false,
         "code": 127,
         "signal": null,
         "cmd": "bundle lock --update rails",
         "stdout": "",
         "stderr": "/bin/sh: 1: bundle: not found\n",
         "message": "Command failed: bundle lock --update rails\n/bin/sh: 1: bundle: not found\n",
         "stack": "Error: Command failed: bundle lock --update rails\n/bin/sh: 1: bundle: not found\n\n    at ChildProcess.exithandler (child_process.js:294:12)\n    at ChildProcess.emit (events.js:198:13)\n    at maybeClose (internal/child_process.js:982:16)\n    at Socket.stream.socket.on (internal/child_process.js:389:11)\n    at Socket.emit (events.js:198:13)\n    at Pipe._handle.close (net.js:606:12)"
       }

@rarkins
Copy link
Collaborator

rarkins commented Aug 26, 2019

@shushugah app or cli?

@shushugah
Copy link

@shushugah app or cli?

CLI and Gitlab version 11.9.4-ee (enterprise edition)

I have included a .ruby-version with ruby 2.6.3, which is additionally specified in the Gemfile as well.

@rarkins
Copy link
Collaborator

rarkins commented Aug 26, 2019

@shushugah the error you paste indicates that bundle is not found. You can't update Gemfiles without bundler installed. If you can't get it working, please post a new issue to https://github.com/renovatebot/config-help/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc so it can be triaged there

@shushugah
Copy link

@shushugah the error you paste indicates that bundle is not found. You can't update Gemfiles without bundler installed. If you can't get it working, please post a new issue to https://github.com/renovatebot/config-help/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc so it can be triaged there

Continuing conversation here, as it's related renovatebot/config-help#336 (comment)

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants