oldmoe / litestack

MIT License
1.02k stars 56 forks source link

Liteboard SQLite3::CantOpenException #81

Closed jamgar closed 5 months ago

jamgar commented 8 months ago

First I want to thank you for this project, and all the hard work being put into it.

Issue: I am trying to get liteboard running, but running into and sqlite error when trying to start the server. The error is /Users/.../.rvm/gems/ruby-3.2.2/gems/sqlite3-1.6.8-x86_64-darwin/lib/sqlite3/database.rb:105:in 'open_v2': unable to open database file (SQLite3::CantOpenException)

Reproduction steps:

  1. Launch a separate terminal and navigate to the root of the app
  2. I enter `liteboard -d ./db/development -E development
  3. get error

I know you are working on the documentation for the liteboard, from a previous ticket, but thought I would try it and see if I can get it going. :) From the error I don't think it is strictly a litestack issue, but maybe I am missing a step so thought I would post here. Any help/guidance you can provide is greatly appreciated. Other then this issue it has been going good using this gem.

oldmoe commented 8 months ago

Thanks for the bug report, can you please share try add the full database path (including the file) to the command line? Also please note that you need to supply the path of the metrics database (defaults to metrics.db) and it should be in the same directory as your main database file

jamgar commented 8 months ago

Adding the full path to the command liteboard -d ./db/development/metrics.sqlite3 -E development did help, but I ran into another issue. 😆

When I navigate to http://localhost:9292/ or any of the other routes (i.e. /topics/Litedb) I get the following error: image

What I have come to find out as I went down a rabbit hole 😆 it seems that URI.escape and URI.unescape are no longer apart of the Ruby api starting with ruby version 3. 🤷 I checked out https://rubyapi.org/3.0/o/uri for version 2.7 and 3.0. I also did a simple test in the rails console for 3.2.2, which is what my project is running and 2.7 in an older project.

3.2.2

image

2.7.3

image

I am just guessing that Hanami::Router needs to be updated to support 3x.

jamgar commented 8 months ago

Oh it looks to be addressed with Hanami::Router v2 https://github.com/hanami/router/issues/218

jamgar commented 8 months ago

I can take a shot a trying to test with v2 and if that works I will make a PR. FYI never contributed to a gem so may have noob questions. 😄

jamgar commented 8 months ago

Updating hanami-router to v2 work 🎉 .

Steps taken: I forked the project. Created a branch. Made change to llitestack.gemspec. Pushed changes to branch. Created a new test app using ruby 3.2.2. Added LiteStack gem and pointed to my fork and branch. (gem 'litestack', git: 'https://github.com/jamgar/litestack', branch: 'update-hanami-router-version') Ran app. In a new tab ran the Liteboard server. Navigated to http://localhost:9292. See the litedb stats.

I will be submitting the PR.