acraven / azure-dependabot

Companion to Updating dependencies in Azure DevOps repos
58 stars 17 forks source link

Fails with Dependabot::DependencyFileNotFound #7

Open OneCyrus opened 4 years ago

OneCyrus commented 4 years ago

i get the following error. any idea where I could start to troubleshoot this?

/opt/hostedtoolcache/Ruby/2.6.6/x64/lib/ruby/gems/2.6.0/gems/dependabot-nuget-0.111.59/lib/dependabot/nuget/file_fetcher.rb:43:in `fetch_files': Dependabot::DependencyFileNotFound (Dependabot::DependencyFileNotFound)
    from /opt/hostedtoolcache/Ruby/2.6.6/x64/lib/ruby/gems/2.6.0/gems/dependabot-common-0.111.59/lib/dependabot/file_fetchers/base.rb:53:in `files'
    from ./update.rb:27:in `<main>'
flcdrg commented 4 years ago

I get this error when trying to run against a project that has the nuget.config file in a subdirectory. When I try it with another project which has that file in the root the it works as expected.

flcdrg commented 4 years ago

Looks like you can add a directory to this bit:

source = Dependabot::Source.new(
  provider: "azure",
  repo: repo,
  directory: "mysubdirectory"
)
specialforest commented 2 years ago

I had the same error message, and the issue was that all files were filtered out by "valid_encoding?" condition in lib/dependabot/nuget/file_fetcher.rb. In my environment LANG environment variable wasn't defined and Ruby was defaulting to US-ASCII encoding. Setting LANG to "C.UTF-8" resolved the issue. It'd be great if dependabot logged skipped files.

Sieberkev commented 6 months ago

I had the same error message, and the issue was that all files were filtered out by "valid_encoding?" condition in lib/dependabot/nuget/file_fetcher.rb. In my environment LANG environment variable wasn't defined and Ruby was defaulting to US-ASCII encoding. Setting LANG to "C.UTF-8" resolved the issue. It'd be great if dependabot logged skipped files.

Thank you so much for your comment, I was searching for hours why it would not detect my requirements.txt file (correct branch, correct directory). Turns out my predecessor saved it as UTF-16.