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

Curl'ing Ruby buildpack fails (most of the time) #196

Closed joshuajansen closed 8 years ago

joshuajansen commented 8 years ago

Output: https://gist.github.com/joshuajansen/5af4bed4ffe86cdd0568d6ec36c3b337

Getting this error approximately 9 out of 10 times on a 1GB Digital Ocean droplet in AMS2 with Dokku v0.7.1

I've been able to reproduce this with both the Ruby 2.3.0 and 2.3.1 buildpacks.

joshuajansen commented 8 years ago

Additional info:

  1. I've deployed the same app to a server that never had these issues: went fine.
  2. I've deployed the same app to a brand new intercity installed droplet: same error

So it seems that my (up to date) intercity instance is not properly setting up the servers. I'll try with a fresh intercity install on a new droplet later :)

jvanbaarsen commented 8 years ago

@joshuajansen Interesting. Might be because of Dokku and the version of Dokku installed. Can you maybe test with this app: github.com/jvanbaarsen/rails-example?

joshuajansen commented 8 years ago

@jvanbaarsen same issue with the rails-example app: https://gist.github.com/joshuajansen/db6f69d3df2de3321dc555dde4e272a8

joshuajansen commented 8 years ago

Dokku version is 0.7.1 btw.

jvanbaarsen commented 8 years ago

@joshuajansen thanks. I can work with this!

jvanbaarsen commented 8 years ago

@joshuajansen Do you run the 64bit or 32bit version of ubuntu?

joshuajansen commented 8 years ago

@jvanbaarsen 16.04.1 x64 for both Intercity server and for the server I'm deploying the apps to.

jvanbaarsen commented 8 years ago

:+1:

joshuajansen commented 8 years ago

Intercity is running on a 512mb server. The app server on 1gb. Both with swap enabled.

jvanbaarsen commented 8 years ago

@joshuajansen I created an issue on the Dokku repo for this. I hope they can help us out a bit. Since I have no clue what is causing this :( https://github.com/dokku/dokku/issues/2411

joshuajansen commented 8 years ago

Thanks @jvanbaarsen !

beydogan commented 8 years ago

I had the same issue for my dokku instance too.

I forked the Ruby buildpack and monkey patched it. I uploaded the ruby files to my server and updated buildpack to download that rubies while building. And set BUILDPACK_URL config to this git repo for all apps.

Here is related code;

https://github.com/beydogan/ruby-buildpack/blob/af704d2ec927fb4774c0de6ac2814c2bcb0fe9c3/lib/language_pack/fetcher.rb#L22

Its not a good approach but i needed something quick :) I will find a better solution soon.

jvanbaarsen commented 8 years ago

@beydogan I believed I solved it in this PR: https://github.com/intercity/intercity-next/pull/205. We are now giving curl more time (5 minutes instead of 30 seconds) to finish the download.

I'm also coordinating with the Dokku people to get this fix upstream into Dokku itself.

beydogan commented 8 years ago

@jvanbaarsen Unfortunately, sometimes it still timeouts even it has 5 minutes timeout. But this is an issue of Dokku, i just wanted to show @joshuajansen a workaround.

jvanbaarsen commented 8 years ago

@beydogan Just curious, are you running your servers at DigitalOcean?

beydogan commented 8 years ago

@jvanbaarsen Yes DigitalOcean but Singapore DC. It was timingout in AMS2 too.

jvanbaarsen commented 8 years ago

@beydogan Hm ok, We are in Amsterdam DC.

jvanbaarsen commented 8 years ago

@beydogan Hm, for now I'll consider this as "fixed". I know it's a suboptimal solution. I'll keep monitoring the situation though!