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

fluent-plugin-generate crashes during gemspec generation #3442

Closed
tagomoris opened this issue Jul 5, 2021 · 2 comments · Fixed by #3444
Closed

fluent-plugin-generate crashes during gemspec generation #3442

tagomoris opened this issue Jul 5, 2021 · 2 comments · Fixed by #3444
Assignees

Comments

@tagomoris
Copy link
Member

Check CONTRIBUTING guideline first and here is the list to help us investigate the problem.

Describe the bug
When I ran fluent-plugin-generate command to generate a skeleton plugin, it crashes with the output below:

$ fluent-plugin-generate input awesome
License: Apache-2.0
	create Gemfile
	create README.md
	create Rakefile
/Users/tagomoris/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/fluentd-1.13.1/lib/fluent/command/plugin_generator.rb:180:in `bundler_version': uninitialized constant FluentPluginGenerator::Bundler (NameError)
	from (erb):23:in `template'
	from /Users/tagomoris/.rbenv/versions/3.0.0/lib/ruby/3.0.0/erb.rb:905:in `eval'
	from /Users/tagomoris/.rbenv/versions/3.0.0/lib/ruby/3.0.0/erb.rb:905:in `result'
	from /Users/tagomoris/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/fluentd-1.13.1/lib/fluent/command/plugin_generator.rb:80:in `template'
	from /Users/tagomoris/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/fluentd-1.13.1/lib/fluent/command/plugin_generator.rb:53:in `block (2 levels) in call'
	from /Users/tagomoris/.rbenv/versions/3.0.0/lib/ruby/3.0.0/pathname.rb:571:in `block in find'
	from /Users/tagomoris/.rbenv/versions/3.0.0/lib/ruby/3.0.0/find.rb:49:in `block (2 levels) in find'
	from /Users/tagomoris/.rbenv/versions/3.0.0/lib/ruby/3.0.0/find.rb:48:in `catch'
	from /Users/tagomoris/.rbenv/versions/3.0.0/lib/ruby/3.0.0/find.rb:48:in `block in find'
	from /Users/tagomoris/.rbenv/versions/3.0.0/lib/ruby/3.0.0/find.rb:43:in `each'
	from /Users/tagomoris/.rbenv/versions/3.0.0/lib/ruby/3.0.0/find.rb:43:in `find'
	from /Users/tagomoris/.rbenv/versions/3.0.0/lib/ruby/3.0.0/pathname.rb:571:in `find'
	from /Users/tagomoris/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/fluentd-1.13.1/lib/fluent/command/plugin_generator.rb:45:in `block in call'
	from /Users/tagomoris/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/fluentd-1.13.1/lib/fluent/command/plugin_generator.rb:43:in `chdir'
	from /Users/tagomoris/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/fluentd-1.13.1/lib/fluent/command/plugin_generator.rb:43:in `call'
	from /Users/tagomoris/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/fluentd-1.13.1/bin/fluent-plugin-generate:5:in `<top (required)>'
	from /Users/tagomoris/.rbenv/versions/3.0.0/bin/fluent-plugin-generate:23:in `load'
	from /Users/tagomoris/.rbenv/versions/3.0.0/bin/fluent-plugin-generate:23:in `<main>'

It seems a failure during generating a gemspec file (according to the order of the sample output in the doc).

To Reproduce
Run fluent-plugin-generate input awesome.

Expected behavior
It finishes successfully, without errors.

Your Environment

  • Fluentd 1.13.1
  • macOS Big Sur (11.4)
  • Ruby 3.0.0 (and 2.7.3 too)

Your Configuration
Nothing.

Your Error Log
See above.

@ashie
Copy link
Member

ashie commented Jul 5, 2021

I've confirmed it when I run it without bundler.
It's caused by #3305
Could you take a look? @kenhys

@kenhys
Copy link
Contributor

kenhys commented Jul 5, 2021

Hmm, it assumed existence of .lock file.

kenhys added a commit to kenhys/fluentd that referenced this issue Jul 5, 2021
In the previous versions, it expected that Fluentd is installed
via bundler, thus it assumes that Gemfile.lock exists.

It is not always true because it may be installed via gem command.
In such a case, we use Gem::Specification.find_by_gem (Gem::Version)
as a fallback.

Closes: fluent#3442

Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
@kenhys kenhys mentioned this issue Jul 12, 2021
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

Successfully merging a pull request may close this issue.

3 participants