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

Updating existing post gives Regenerating: 1 file(s) changed at 2017-11-06 16:38:19 2017-11-06 16:38:19 - NoMethodError - undefined method `to_api' for nil:NilClass: in collection.rb line 32 #426

Closed
angsuman opened this issue Nov 6, 2017 · 7 comments
Labels

Comments

@angsuman
Copy link

angsuman commented Nov 6, 2017

Description:

When an existing post is modified and then saved, it gives the following error:

Regenerating: 1 file(s) changed at 2017-11-06 16:38:19 2017-11-06 16:38:19 - NoMethodError - undefined method `to_api' for nil:NilClass:
	/home/pi/.rvm/gems/ruby-2.4.1/gems/jekyll-admin-0.7.0/lib/jekyll-admin/server/collection.rb:32:in `block (2 levels) in <class:Server>'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1611:in `call'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1611:in `block in compile!'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:975:in `block (3 levels) in route!'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:994:in `route_eval'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:975:in `block (2 levels) in route!'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1015:in `block in process_route'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1013:in `catch'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1013:in `process_route'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:973:in `block in route!'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:972:in `each'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:972:in `route!'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1085:in `block in dispatch!'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `block in invoke'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `catch'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `invoke'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1082:in `dispatch!'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:907:in `block in call!'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `block in invoke'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `catch'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `invoke'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:907:in `call!'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/bisase.rb:895:in `call'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/rack-protection-1.5.3/lib/rack/protection/xss_header.rb:18:in `call'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/rack-protectioRegRegenerating: 1 file(s) changed at 2017-11-06 16:38:19 2017-11-06 16:38:19 - NoMethodError - undefined method `to_api' for nil:NilClass:
	/home/pi/.rvm/gems/ruby-2.4.1/gems/jekyll-admin-0.7.0/lib/jekyll-admin/server/collection.rb:32:in `block (2 levels) in <class:Server>'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1611:in `call'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1611:in `block in compile!'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:975:in `block (3 levels) in route!'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:994:in `route_eval'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:975:in `block (2 levels) in route!'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1015:in `block in process_route'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1013:in `catch'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1013:in `process_route'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:973:in `block in route!'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:972:in `each'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:972:in `route!'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1085:in `block in dispatch!'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `block in invoke'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `catch'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `invoke'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1082:in `dispatch!'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:907:in `block in call!'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `block in invoke'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `catch'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `invoke'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:907:in `call!'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/bisase.rb:895:in `call'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/rack-protection-1.5.3/lib/rack/protection/xss_header.rb:18:in `call'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/rack-protection-1.5.3/lib/rack/protection/path_traversal.rb:16:in `call'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/rack-protection-1.5.3/lib/rack/protection/json_csrf.rb:18:in `call'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/rack-protection-1.5.3/lib/rack/protection/frame_options.rb:31:in `call'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/rack-1.6.8/lib/rack/nulllogger.rb:9:in `call'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/rack-1.6.8/lib/rack/head.rb:13:in `call'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:182:in `call'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:2013:in `call'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1487:in `block in call'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/bisase.rb:1787:in `synchronize'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1487:in `call'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/rack-1.6.8/lib/rack/handler/webrick.rb:88:in `service'
	/home/pi/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/webrick/httpserver.rb:140:in `service'
	/home/pi/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/webrick/httpserver.rb:96:in `run'
	/home/pi/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/webrick/server.rb:290:in `block in start_thread'enerating: 1 file(s) changed at 2017-11-06 16:38:19 2017-11-06 16:38:19 - NoMethodError - undefined method `to_api' for nil:NilClass:
	/home/pi/.rvm/gems/ruby-2.4.1/gems/jekyll-admin-0.7.0/lib/jekyll-admin/server/collection.rb:32:in `block (2 levels) in <class:Server>'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1611:in `call'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1611:in `block in compile!'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:975:in `block (3 levels) in route!'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:994:in `route_eval'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:975:in `block (2 levels) in route!'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1015:in `block in process_route'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1013:in `catch'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1013:in `process_route'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:973:in `block in route!'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:972:in `each'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:972:in `route!'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1085:in `block in dispatch!'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `block in invoke'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `catch'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `invoke'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1082:in `dispatch!'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:907:in `block in call!'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `block in invoke'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `catch'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `invoke'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:907:in `call!'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/bisase.rb:895:in `call'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/rack-protection-1.5.3/lib/rack/protection/xss_header.rb:18:in `call'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/rack-protection-1.5.3/lib/rack/protection/path_traversal.rb:16:in `call'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/rack-protection-1.5.3/lib/rack/protection/json_csrf.rb:18:in `call'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/rack-protection-1.5.3/lib/rack/protection/frame_options.rb:31:in `call'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/rack-1.6.8/lib/rack/nulllogger.rb:9:in `call'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/rack-1.6.8/lib/rack/head.rb:13:in `call'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:182:in `call'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:2013:in `call'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1487:in `block in call'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/bisase.rb:1787:in `synchronize'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1487:in `call'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/rack-1.6.8/lib/rack/handler/webrick.rb:88:in `service'
	/home/pi/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/webrick/httpserver.rb:140:in `service'
	/home/pi/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/webrick/httpserver.rb:96:in `run'
	/home/pi/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/webrick/server.rb:290:in `block in start_thread'n-1.5.3/lib/rack/protection/path_traversal.rb:16:in `call'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/rack-protection-1.5.3/lib/rack/protection/json_csrf.rb:18:in `call'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/rack-protection-1.5.3/lib/rack/protection/frame_options.rb:31:in `call'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/rack-1.6.8/lib/rack/nulllogger.rb:9:in `call'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/rack-1.6.8/lib/rack/head.rb:13:in `call'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:182:in `call'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:2013:in `call'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1487:in `block in call'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/bisase.rb:1787:in `synchronize'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1487:in `call'
	/home/pi/.rvm/gems/ruby-2.4.1/gems/rack-1.6.8/lib/rack/handler/webrick.rb:88:in `service'
	/home/pi/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/webrick/httpserver.rb:140:in `service'
	/home/pi/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/webrick/httpserver.rb:96:in `run'
	/home/pi/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/webrick/server.rb:290:in `block in start_thread'

Tell us a bit about yourself:

  • Version of JekyllAdmin I'm using <HINT: use bundle show to check>: 0.7.0
  • Version of Jekyll I'm using <HINT: use bundle show to check>: 3.6.2
  • Version of NodeJS I'm using <HINT: use node -v to check>: 6.11.5
  • Operating System <e.g. OS X, Windows>: Raspbian
  • Browser <e.g, Safari, Chrome>: Chrome

Steps to reproduce:

  • Open /admin/
  • click on Posts
  • click on any post to edit.
  • click on save

I expected the following:

save without any error

But got the following, instead:

On terminal running jekyll, I get the above mentioned error everytime, even though the post appears to be saved. Additionally the UI informs me, 'Could not update the doc'.

Other details:

@mertkahyaoglu
Copy link
Member

mertkahyaoglu commented Nov 9, 2017

Is this happening in development?

@angsuman
Copy link
Author

angsuman commented Nov 10, 2017 via email

@Ilphrin
Copy link

Ilphrin commented Nov 23, 2017

Hi!

I have the same issue:/ :

Jekyll 3.6.2
jekyll-admin: 0.7.0

@angsuman
Copy link
Author

angsuman commented Nov 24, 2017

This happens on saving new posts too. I found it on Ubuntu 16.0.4 as well as Raspbian.

@mertkahyaoglu
Copy link
Member

Looks like bringing watch back is causing trouble again. Going to investigate this 👍

@angsuman
Copy link
Author

angsuman commented Dec 8, 2017

fyi: This does not happen while updating pages. Only for posts.

@jekyllbot
Copy link

This issue has been automatically marked as stale because it has not been commented on for at least two months.

The resources of the Jekyll team are limited, and so we are asking for your help.

If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.

If this is a feature request, please consider whether it can be accomplished in another way. If it cannot, please elaborate on why it is core to this project and why you feel more than 80% of users would find this beneficial.

This issue will automatically be closed in two months if no further activity occurs. Thank you for all your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants