standardnotes / forum

Support from other community members. For 1-on-1 help, please contact help@standardnotes.com.
https://forum.standardnotes.org
197 stars 9 forks source link

Private server - Internal Server Error #2012

Closed Svarto closed 6 years ago

Svarto commented 6 years ago

Hi,

Thanks for a great piece of software, I am trying to self-host this and have gotten my Standardfile server up and running but running into problems with Standardnote 2.0.2.

Specifically, I follow these installation steps:

bundle install
npm install
bundle exec rake bower:install
grunt
rails s

The only difference is that as in Standardfile I run it with rail s -e production -p 2999. It works to get the server up and running but I had to go into the config/environment/production.rb and change config.force_ssl = false as I have the SSL endpoint on another reverse proxy for this VM cluster.

When I try and access the standardnote server on http://lan-ip:2999, I get a "We're sorry, but something went wrong", checking the logs:

Processing by ApplicationController#frontend as HTML
Completed 500 Internal Server Error in 1ms

NoMethodError (undefined method `<<' for nil:NilClass):

app/controllers/application_controller.rb:25:in `set_app_domain'
app/controllers/application_controller.rb:11:in `frontend'
Started GET "/favicon.ico" for 10.0.0.99 at 2018-08-03 07:23:29 +0200

ActionController::RoutingError (No route matches [GET] "/favicon.ico"):

actionpack (5.0.0.1) lib/action_dispatch/middleware/debug_exceptions.rb:53:in `call'
actionpack (5.0.0.1) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
railties (5.0.0.1) lib/rails/rack/logger.rb:36:in `call_app'
railties (5.0.0.1) lib/rails/rack/logger.rb:26:in `call'
actionpack (5.0.0.1) lib/action_dispatch/middleware/request_id.rb:24:in `call'
rack (2.0.5) lib/rack/method_override.rb:22:in `call'
rack (2.0.5) lib/rack/runtime.rb:22:in `call'
activesupport (5.0.0.1) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
actionpack (5.0.0.1) lib/action_dispatch/middleware/executor.rb:12:in `call'
rack (2.0.5) lib/rack/sendfile.rb:111:in `call'
rack (2.0.5) lib/rack/deflater.rb:34:in `call'
rack-cors (1.0.2) lib/rack/cors.rb:97:in `call'
secure_headers (6.0.0) lib/secure_headers/middleware.rb:13:in `call'
railties (5.0.0.1) lib/rails/engine.rb:522:in `call'
puma (3.12.0) lib/puma/configuration.rb:225:in `call'
puma (3.12.0) lib/puma/server.rb:658:in `handle_request'
puma (3.12.0) lib/puma/server.rb:472:in `process_client'
puma (3.12.0) lib/puma/server.rb:332:in `block in run'
puma (3.12.0) lib/puma/thread_pool.rb:133:in `block in spawn_thread'

Any idea what is wrong?

moughxyz commented 6 years ago

set_app_domain was removed a very long time ago. I would just try pulling in the latest changes from master. Any reason you're using an older version?

Svarto commented 6 years ago

Ok I'll try again, I ran into the problem that when running grunt it threw and error when compiling one of the javascripts in the ngAnnotate section. That is why I switched to the 2.0.2 version as I thought maybe the master branch was unstable. I'll try again with the master branch and report back!

Svarto commented 6 years ago

I tried it again with the master branch and got the server up and running, I still can't connect though. When I run it with rails s -e production -p 2999 I get this error:

HTTP parse error, malformed request (): #<Puma::HttpParserError: Invalid HTTP format, parsing fails.

Is there anything to fix this? As when I use the development environment I can't load it either, but that is because the rails server is bound to localhost:2999 and not its ip. Can I somehow change this in development to bind to 0.0.0.0:2999 or its own IP, or do I need to install another reverse proxy on the machine to proxypass to localhost?

Thanks a lot for your help.

moughxyz commented 6 years ago

You should be able to bind with something like rails s -b 0.0.0.0 -p 3000 (Going off memory so it might be slightly different).

As for the error, you'll have to give more details. Not enough info to work with based on just that..

Svarto commented 6 years ago

worked perfectly with mobitars comment to keep it in development but then bind the listening ip to 0.0.0.0.