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

Crashes on startup #85

Open
icarito opened this issue Oct 12, 2020 · 3 comments
Open

Crashes on startup #85

icarito opened this issue Oct 12, 2020 · 3 comments

Comments

@icarito
Copy link
Member

icarito commented Oct 12, 2020

Running the command as per Dockerfile:

ruby app.rb ....

just returns. No server is started. This is causing crash loop.

@icarito
Copy link
Member Author

icarito commented Oct 12, 2020

Last working container since January.

@jywarren
Copy link
Member

:-(

So, looking at the commit history, that would be 7aa8ce7

Travis has passed on basically everything since then, so hopefully it's a small issue in 60af4ea or 1ed55b4 ?

60af4ea makes significant changes to the Dockerfile. It was part of pull request #58

Actually it seems the changes are reverted in later commits, so the ultimate changes merged were not that significant:

https://github.com/publiclab/mapknitter-exporter-sinatra/pull/58/files

So, we should be perhaps running ruby app.rb in our tests just as a check -- we could add a .travis.yml entry for that:

jobs:
include:
- name: "Exporter Tests"
script: bundle exec rspec
- name: "Rubocop Build"
script: bundle exec rubocop
- name: "Docker Build"
script: docker build . -t lib-mapknitter-exporter:latest

We are requiring app.rb but we aren't running it with ruby app.rb --

require_relative "../app.rb"
require "rspec"
require "rack/test"
describe "Mapknitter Exporter" do
include Rack::Test::Methods
def app
Sinatra::Application
end
it "displays Mapknitter Exporter text" do
get "/"
expect(last_response.body).to match("Mapknitter Exporter")
end

Trying to boot it up in GitPod... got what you did.

https://github.com/publiclab/mapknitter-exporter-sinatra/commits/main/app.rb has had 2 commits since Jan...

@jywarren
Copy link
Member

5e50ff9 and 5f3ab82 ...

whoaaaa...

require_relative "lib/export.rb"

I think that's a mistake -- shouldn't app.rb be:

require_relative "app/controllers/export_controller.rb" ? Even when I change it to that, the app doesn't boot.

Hmm, chasing that require, it went to:

require_relative "../app/controllers/export_controller.rb"

@alaxalves something weird is happening here. Isn't ruby app.rb supposed to boot the application? If not, could you note the command to do so?

https://github.com/publiclab/mapknitter-exporter-sinatra/commits/main/lib/export.rb

I'm a little confused at why it's requiring the lib/export.rb file -- why do we have that file, shouldn't it be using the gem at https://github.com/publiclab/mapknitter-exporter ? We had been doing that here:

require "mapknitterExporter"

Any help appreciated, thanks @alaxalves !

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

No branches or pull requests

2 participants