intercity / intercity-next

Web control panel to deploy apps on your servers (with Dokku)
https://intercity.io/
MIT License
116 stars 23 forks source link

After a few minutes server stops loading pages #229

Closed francisschmaltz closed 6 years ago

francisschmaltz commented 6 years ago

After 15 or so minutes intercity stops loading server or apps pages and gives the error:

We're sorry, but something went wrong.

If you are the application owner check the logs for more information.

Ubuntu 16.04 fresh install

jvanbaarsen commented 6 years ago

Hi, this is the Intercity server that is causing the problems? Or is it an app you created with Intercity?

francisschmaltz commented 6 years ago

Hey @jvanbaarsen this is the Intercity server. I have reproduced on fresh installs with only intercity installed and setting itself as a server with the IP (not localhost or 127.0.0.1)

francisschmaltz commented 6 years ago

It also occurs when adding other servers as well

jvanbaarsen commented 6 years ago

@francisschmaltz Thanks for the extra information, I'll take a look at this tomorrow morning!

francisschmaltz commented 6 years ago

Sounds good! Let me know if you need logs or anything. Thanks!

francisschmaltz commented 6 years ago

Too add info, in the nginx log I get this read out 10.105.231.169 - - [26/Oct/2017:17:48:18 +0000] "GET /servers/1/apps HTTP/1.1" 500 1477 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/604.3.5 (KHTML, like Gecko) Version/11.0.1 Safari/604.3.5"

francisschmaltz commented 6 years ago

and from production.log

I, [2017-10-26T17:48:18.275756 #27]  INFO -- : [05880d2d-d542-4f8d-b309-462882f96c79] Started GET "/servers/1/apps" for 10.105.231.169 at 2017-10-26 17:48:18 +0000
I, [2017-10-26T17:48:18.276586 #27]  INFO -- : [05880d2d-d542-4f8d-b309-462882f96c79] Processing by AppsController#index as HTML
I, [2017-10-26T17:48:18.276684 #27]  INFO -- : [05880d2d-d542-4f8d-b309-462882f96c79]   Parameters: {"server_id"=>"1"}
D, [2017-10-26T17:48:18.277711 #27] DEBUG -- : [05880d2d-d542-4f8d-b309-462882f96c79]   User Load (0.2ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2  [["id", 1], ["LIMIT", 1]]
D, [2017-10-26T17:48:18.278829 #27] DEBUG -- : [05880d2d-d542-4f8d-b309-462882f96c79]    (0.3ms)  SELECT COUNT(*) FROM "users"
D, [2017-10-26T17:48:18.279591 #27] DEBUG -- : [05880d2d-d542-4f8d-b309-462882f96c79]   Setting Load (0.3ms)  SELECT  "settings".* FROM "settings" ORDER BY "settings"."id" ASC LIMIT $1  [["LIMIT", 1]]
D, [2017-10-26T17:48:18.280483 #27] DEBUG -- : [05880d2d-d542-4f8d-b309-462882f96c79]   Server Load (0.2ms)  SELECT  "servers".* FROM "servers" WHERE "servers"."id" = $1 LIMIT $2  [["id", 1], ["LIMIT", 1]]
D, [2017-10-26T17:48:18.281249 #27] DEBUG -- : [05880d2d-d542-4f8d-b309-462882f96c79]   CACHE (0.0ms)  SELECT  "servers".* FROM "servers" WHERE "servers"."id" = $1 LIMIT $2  [["id", 1], ["LIMIT", 1]]
D, [2017-10-26T17:48:18.282216 #27] DEBUG -- : [05880d2d-d542-4f8d-b309-462882f96c79]   App Load (0.3ms)  SELECT "apps".* FROM "apps" WHERE "apps"."server_id" = 1
I, [2017-10-26T17:48:18.283653 #27]  INFO -- : [05880d2d-d542-4f8d-b309-462882f96c79]   Rendering apps/index.html.erb within layouts/application
I, [2017-10-26T17:48:18.286086 #27]  INFO -- : [05880d2d-d542-4f8d-b309-462882f96c79]   Rendered servers/_heading.html.erb (2.2ms)
I, [2017-10-26T17:48:18.286187 #27]  INFO -- : [05880d2d-d542-4f8d-b309-462882f96c79]   Rendered apps/index.html.erb within layouts/application (2.4ms)
I, [2017-10-26T17:48:18.286335 #27]  INFO -- : [05880d2d-d542-4f8d-b309-462882f96c79] Completed 500 Internal Server Error in 10ms (ActiveRecord: 1.2ms)
F, [2017-10-26T17:48:18.287148 #27] FATAL -- : [05880d2d-d542-4f8d-b309-462882f96c79]   
F, [2017-10-26T17:48:18.287194 #27] FATAL -- : [05880d2d-d542-4f8d-b309-462882f96c79] ActionView::Template::Error (undefined method `[]' for nil:NilClass):
F, [2017-10-26T17:48:18.287322 #27] FATAL -- : [05880d2d-d542-4f8d-b309-462882f96c79]      9:     </ul>
F, [2017-10-26T17:48:18.287362 #27] FATAL -- : [05880d2d-d542-4f8d-b309-462882f96c79]     10:   </div>
F, [2017-10-26T17:48:18.287396 #27] FATAL -- : [05880d2d-d542-4f8d-b309-462882f96c79]     11: </div>
F, [2017-10-26T17:48:18.287427 #27] FATAL -- : [05880d2d-d542-4f8d-b309-462882f96c79]     12: <%= render("servers/outdated", server: server) unless server.up_to_date? %>
F, [2017-10-26T17:48:18.287462 #27] FATAL -- : [05880d2d-d542-4f8d-b309-462882f96c79]     13: <%= render "flashes" -%>
F, [2017-10-26T17:48:18.287495 #27] FATAL -- : [05880d2d-d542-4f8d-b309-462882f96c79]   
F, [2017-10-26T17:48:18.287527 #27] FATAL -- : [05880d2d-d542-4f8d-b309-462882f96c79] app/models/server.rb:30:in `up_to_date?'
F, [2017-10-26T17:48:18.287559 #27] FATAL -- : [05880d2d-d542-4f8d-b309-462882f96c79] app/views/servers/_heading.html.erb:12:in `_app_views_servers__heading_html_erb___821151073869839965_47137798292480'
F, [2017-10-26T17:48:18.287593 #27] FATAL -- : [05880d2d-d542-4f8d-b309-462882f96c79] app/views/apps/index.html.erb:1:in `_app_views_apps_index_html_erb__70944554280222757_47137798430220'
jvanbaarsen commented 6 years ago

@francisschmaltz Thanks for that last log! I'll try to recreate locally.

jvanbaarsen commented 6 years ago

@francisschmaltz Ok, quick update on this, somehow Dokku is not installed on the server you added via Intercity (Which is a separate issue that I'll look into).

We have a version checker in place to see if your Dokku installation on a server is still up to date, if it's not we will show you a warning.

In order to keep track of this, we have a background job running that checks every 30 minutes if a server is still online, and if it is we fetch the Dokku version.

Since Dokku is not installed, we don't get a version back, and the page is crashing.

For me the next actions are:

  1. Patch Intercity so we fail gracefully if we don;t get a Dokku version back (And thus not showing this error)
  2. Update the Dokku version we are installing with Intercity
  3. Add better checks to see if we actually installed a server properly.
francisschmaltz commented 6 years ago

@jvanbaarsen Thanks! Is there a work around in the mean time?

jvanbaarsen commented 6 years ago

@francisschmaltz Once thing that might help, but I didn't test it myself is to manually install Dokku on your application server. But I've prepared a fix for this crash and will release that this week.