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

Invalid function npm:update #867

Open
morpheus-87 opened this issue Oct 17, 2022 · 1 comment
Open

Invalid function npm:update #867

morpheus-87 opened this issue Oct 17, 2022 · 1 comment

Comments

@morpheus-87
Copy link

morpheus-87 commented Oct 17, 2022

I'm using this dependabot-script to update dependencies for repositories hosted on a private GitLab installation. For most of the repositories it's working like a charm, but for one repository I get a weird error:

$ bundle exec ruby ./generic-update-script.rb
warning: parser/current is loading parser/ruby27, which recognizes
warning: 2.7.1-compliant syntax, but you are running 2.7.6.
warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.
Fetching npm_and_yarn dependency files for foobar/cool-repository
Parsing dependencies information
  - Updating @aeaton/prosemirror-footnotes (from 0.1.0)…/builds/foobar/dependabot/vendor/ruby/2.7.0/gems/dependabot-common-0.118.8/lib/dependabot/shared_helpers.rb:111:in `run_helper_subprocess': Invalid function npm:update (Dependabot::SharedHelpers::HelperSubprocessFailed)
	from /builds/foobar/dependabot/vendor/ruby/2.7.0/gems/dependabot-npm_and_yarn-0.118.8/lib/dependabot/npm_and_yarn/file_updater/npm_lockfile_updater.rb:151:in `run_npm_top_level_updater'
	from /builds/foobar/dependabot/vendor/ruby/2.7.0/gems/dependabot-npm_and_yarn-0.118.8/lib/dependabot/npm_and_yarn/file_updater/npm_lockfile_updater.rb:139:in `block in run_npm_updater'
	from /builds/foobar/dependabot/vendor/ruby/2.7.0/gems/dependabot-common-0.118.8/lib/dependabot/shared_helpers.rb:141:in `with_git_configured'
	from /builds/foobar/dependabot/vendor/ruby/2.7.0/gems/dependabot-npm_and_yarn-0.118.8/lib/dependabot/npm_and_yarn/file_updater/npm_lockfile_updater.rb:137:in `run_npm_updater'
	from /builds/foobar/dependabot/vendor/ruby/2.7.0/gems/dependabot-npm_and_yarn-0.118.8/lib/dependabot/npm_and_yarn/file_updater/npm_lockfile_updater.rb:115:in `run_current_npm_update'
	from /builds/foobar/dependabot/vendor/ruby/2.7.0/gems/dependabot-npm_and_yarn-0.118.8/lib/dependabot/npm_and_yarn/file_updater/npm_lockfile_updater.rb:35:in `block (2 levels) in updated_lockfile_content'
	from /builds/foobar/dependabot/vendor/ruby/2.7.0/gems/dependabot-npm_and_yarn-0.118.8/lib/dependabot/npm_and_yarn/file_updater/npm_lockfile_updater.rb:34:in `chdir'
	from /builds/foobar/dependabot/vendor/ruby/2.7.0/gems/dependabot-npm_and_yarn-0.118.8/lib/dependabot/npm_and_yarn/file_updater/npm_lockfile_updater.rb:34:in `block in updated_lockfile_content'
	from /builds/foobar/dependabot/vendor/ruby/2.7.0/gems/dependabot-common-0.118.8/lib/dependabot/shared_helpers.rb:37:in `block (2 levels) in in_a_temporary_directory'
	from /builds/foobar/dependabot/vendor/ruby/2.7.0/gems/dependabot-common-0.118.8/lib/dependabot/shared_helpers.rb:37:in `chdir'
	from /builds/foobar/dependabot/vendor/ruby/2.7.0/gems/dependabot-common-0.118.8/lib/dependabot/shared_helpers.rb:37:in `block in in_a_temporary_directory'
	from /usr/local/lib/ruby/2.7.0/tmpdir.rb:89:in `mktmpdir'
	from /builds/foobar/dependabot/vendor/ruby/2.7.0/gems/dependabot-common-0.118.8/lib/dependabot/shared_helpers.rb:34:in `in_a_temporary_directory'
	from /builds/foobar/dependabot/vendor/ruby/2.7.0/gems/dependabot-npm_and_yarn-0.118.8/lib/dependabot/npm_and_yarn/file_updater/npm_lockfile_updater.rb:30:in `updated_lockfile_content'
	from /builds/foobar/dependabot/vendor/ruby/2.7.0/gems/dependabot-npm_and_yarn-0.118.8/lib/dependabot/npm_and_yarn/file_updater.rb:187:in `updated_package_lock_content'
	from /builds/foobar/dependabot/vendor/ruby/2.7.0/gems/dependabot-npm_and_yarn-0.118.8/lib/dependabot/npm_and_yarn/file_updater.rb:120:in `package_lock_changed?'
	from /builds/foobar/dependabot/vendor/ruby/2.7.0/gems/dependabot-npm_and_yarn-0.118.8/lib/dependabot/npm_and_yarn/file_updater.rb:149:in `block in updated_lockfiles'
	from /builds/foobar/dependabot/vendor/ruby/2.7.0/gems/dependabot-npm_and_yarn-0.118.8/lib/dependabot/npm_and_yarn/file_updater.rb:148:in `each'
	from /builds/foobar/dependabot/vendor/ruby/2.7.0/gems/dependabot-npm_and_yarn-0.118.8/lib/dependabot/npm_and_yarn/file_updater.rb:148:in `updated_lockfiles'
	from /builds/foobar/dependabot/vendor/ruby/2.7.0/gems/dependabot-npm_and_yarn-0.118.8/lib/dependabot/npm_and_yarn/file_updater.rb:39:in `updated_dependency_files'
	from ./generic-update-script.rb:207:in `block in <main>'
	from ./generic-update-script.rb:169:in `each'
	from ./generic-update-script.rb:169:in `<main>'

Does anyone know, what the reason for this error could be?

Edit: The process is running inside a docker container built from image dependabot/dependabot-core:0.212.0.

@jeffwidman
Copy link
Member

Your best bet is to drop some binding.B or puts statements and start walking through where this gets called... it looks like there's some problem calling npm:update but not clear what command was that dependabot-core shelled out to npm with that resulted in that... if you can figure out the command, then run it natively with npm to see if it's throwing that error w/o dependabot-core... it'll probably give you a little more info so you can see if it's something in your repo, or npm or dependabot-core...

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

2 participants