jekyll / jekyll-admin

A Jekyll plugin that provides users with a traditional CMS-style graphical interface to author content and administer Jekyll sites.
https://jekyll.github.io/jekyll-admin/
MIT License
2.85k stars 365 forks source link

Blank Page with error log #706

Open nanocodex opened 9 months ago

nanocodex commented 9 months ago

Description:

I was locally hosting WhatATheme for my personal website. But when I navigated to http://localhost:4000/admin, I got the error log shown below.

Tell us a bit about yourself:

Steps to reproduce:

  1. Install WhatATheme
  2. Run bundle exec jekyll serve --livereload
  3. Go to http://localhost:4000/admin
  4. View powershell terminal

I expected the following:

The Jekyll Admin GUI for version 0.9.0 to load

But got the following, instead:

A blank page and the following chunk of error log:

Configuration file: C:/.../nanocodex.github.io/_config.yml Configuration file: C:/.../nanocodex.github.io/_config.yml 2024-02-18 12:52:03 - TypeError - no implicit conversion of Hash into Integer: C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/jekyll-admin-0.9.0/lib/jekyll-admin/server/configuration.rb:36:in read' C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/jekyll-admin-0.9.0/lib/jekyll-admin/server/configuration.rb:36:inraw_configuration'
C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/jekyll-admin-0.9.0/lib/jekyll-admin/server/configuration.rb:7:in block (2 levels) in <class:Server>' C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1611:incall' C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1611:in block in compile!' C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:975:inblock (3 levels) in route!' C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:994:in route_eval' C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:975:inblock (2 levels) in route!' C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1015:in block in process_route' C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1013:incatch' C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1013:in process_route' C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:973:inblock in route!' C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:972:in each' C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:972:inroute!' C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1085:in block in dispatch!' C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:inblock in invoke' C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in catch' C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:ininvoke' C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1082:in dispatch!' C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:907:inblock in call!' C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in block in invoke' C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:incatch' C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in invoke' C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:907:incall!' C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:895:in call' C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/rack-protection-1.5.5/lib/rack/protection/xss_header.rb:18:incall' C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/rack-protection-1.5.5/lib/rack/protection/path_traversal.rb:16:in call' C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/rack-protection-1.5.5/lib/rack/protection/json_csrf.rb:18:incall' C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/rack-protection-1.5.5/lib/rack/protection/base.rb:49:in call' C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/rack-protection-1.5.5/lib/rack/protection/base.rb:49:incall' C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/rack-protection-1.5.5/lib/rack/protection/frame_options.rb:31:in call' C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/rack-1.6.13/lib/rack/nulllogger.rb:9:incall' C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/rack-1.6.13/lib/rack/head.rb:13:in call' C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:182:incall' C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:2013:in call' C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1487:inblock in call' C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1787:in synchronize' C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1487:incall' C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/rack-1.6.13/lib/rack/handler/webrick.rb:88:in service' C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/webrick-1.8.1/lib/webrick/httpserver.rb:140:inservice' C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/webrick-1.8.1/lib/webrick/httpserver.rb:96:in run' C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/webrick-1.8.1/lib/webrick/server.rb:310:inblock in start_thread'

Other details:

  1. I censored out the user directory in the first two lines of the error log
  2. Under Jekyll Installation Requirements, I realised that I do not have GCC and Make installed. I would prefer not to download them however, because the download page for them is way too confusing for me to navigate 😵‍💫
  3. The source files for my personal website is available here
  4. I asked my friend @dentolos19 to see if he could get it working on his machine. But when he tried using Jekyll Admin on Docker, he received the same error message.
  5. I am aware that this issue is very similar to another one, but the OP for that issue had a different error log in their console (with the little information present I could infer in the attached screenshot)
nanocodex commented 7 months ago

Update: The solution I found was to update jekyll-admin to the latest version: gem 'jekyll-admin', '~> 0.11.1'

Also relevant

I got the following error when I tried launching Jekyll Admin on rack version 3.0.10:

<internal:C:/Ruby32-x64/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require': cannot load such file -- rack/handler (LoadError)

After searching, I found this post saying that:

As of version 3.0 Rack::Handler was removed from rack and pulled out into its own gem (rackup).

To fix the error, add gem 'rackup' to the gemfile:

gem 'rack'
gem 'rackup'
nanocodex commented 7 months ago

Update

Upon further local testing, it seems that Jekyll Admin has trouble allowing me to change and edit files when using the rack ~> 3.0 and rackup gems.

Respective versions that caused this bug to happen are as follows:

Rolling back rack to a version below 3.0 (I used version 1.6.13) and hence removing the rackup gem seems to solve the problem. However, Jekyll Admin still says that it "could not fetch the config" even if the _config.yml file was successfully updated. Just like the issue linked, it has the exact same issue when updating any other file in the site.

Also to note

Regardless of whether Jekyll Admin is using gem "rack", "< 3.0" or gem "rack", "~> 3.0" paired with gem "rackup", the homepage configuration no longer works, instead always defaulting to pages. No matter what you set it as in _config.yml:

jekyll_admin:
  homepage: "posts"

The above configuration does not work.

vcavallo commented 6 months ago

https://github.com/jekyll/jekyll-admin/issues/620#issuecomment-2140730297