unicorn

HTTP 502: Whoops, GitLab is taking too much time to respond.

落花浮王杯 提交于 2019-12-02 04:18:18
最近有台云上的服务器需要释放,然后上面跑的 gitlab 也要挪个地方,如在 docker 内运行,gitlab 镜像大约 1.56G,需占用 4G 以上的内存,因资源有限,于是借在其他的服务器上搭建环境(可用内存小于4G),然鹅启动的时候莫名出现 502,Excuse me?接着搜了一些 issue 博客上的解决方案(如修改端口、重启或 hup 某个服务)无果,后来在调整的过程中从日志里发现了一些信息。 这次排错过程主要是思路,视野打开后会觉得豁然开朗,原来这其实是个小问题[尴尬]。 1、不清楚应用启动的各服务以及用途,只会简单查看 status; 2、看到错误第一时间想到的是 Baidu(没其他意思),找找 logpath 先看日志不好吗? 3、未认识到服务之间的关联关系(比如 postgresql 与 unicorn 之间),前面一直知道 unicorn 启动后没正常监听到端口,但是日志并没啥特别信息(嗯,可能是因为看错了文件)[苦笑] 一、错误信息 二、排错过程 1、启动 unicorn 未监听端口 日志路径 : /var/log/gitlab/unicorn/unicorn_stderr.log PG::ConnectionBad: could not connect to server: No such file or directory Is the server

Occasional Postgres error on Heroku: could not translate host name “<pg URL>” to address: Name or service not known (PG::Error)

穿精又带淫゛_ 提交于 2019-12-01 18:04:53
I'm using the shared postgres (dev / free) plan right now on Heroku and I see this error in my logs a decent amount. Connecting to the PG database does usually work though, so I'm not sure if this is something that's within my control. The Heroku Status page does not list any downtime for the shared databases when these occur. Using Rails 3.1.1 and the Unicorn web server . Error: could not translate host name "pg60.sharedpg.heroku.com ( http://pg60.sharedpg.heroku.com )" to address: Name or service not known (PG::Error) My Unicorn config file (after looking around at the recommended settings

POST request mysteriously turn into GET request

蹲街弑〆低调 提交于 2019-12-01 12:40:05
I have a Rails 4.1 application with unicorn and nginx. But somehow/mysteriously my POST request turn into GET request. Here is the request header: Remote Address: <<IP>> Request URL: <<URL>> Request Method:POST Status Code:301 Moved Permanently Request Headersview source Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 Accept-Encoding:gzip,deflate,sdch Accept-Language:en-US,en;q=0.8,ru;q=0.6,bg;q=0.4,mn;q=0.2,nb;q=0.2 Cache-Control:no-cache Connection:keep-alive Content-Length:14269 Content-Type:application/x-www-form-urlencoded Cookie:<<COOKIES>> Host:<<HOST>>

POST request turns into GET request

假装没事ソ 提交于 2019-12-01 12:16:39
问题 I have a Rails 4.1 application with nginx and unicorn. Some of POST request are turn into GET request. I gues it's related my nginx config. Here is the previous question about it. Here is the my nginx.conf file: # you generally only need one nginx worker unless you're serving # large amounts of static files which require blocking disk reads worker_processes 3; # # drop privileges, root is needed on most systems for binding to port 80 # # (or anything < 1024). Capability-based security may be

Rails 404 error for Stylesheet or JavaScript files

大城市里の小女人 提交于 2019-12-01 11:54:31
Rails can't load (404 error) CSS & JS files on production but has no problem loading them in development. I'm using Capistrano for deployment and running Rails 3. My path on development is /www/myapp but my path on production is /www/myapp/current . The application itself seems to work fine, so the issue seems to be isolated to CSS/JS files. I tried setting the RAILS_ROOT variable to /www/myapp/current in environments/production.rb but it did not make any difference, the files still don't load. Here's the full stack from the production log: Started GET "/stylesheets/scaffold.css?1280867531"

POST request mysteriously turn into GET request

自闭症网瘾萝莉.ら 提交于 2019-12-01 11:07:38
问题 I have a Rails 4.1 application with unicorn and nginx. But somehow/mysteriously my POST request turn into GET request. Here is the request header: Remote Address: <<IP>> Request URL: <<URL>> Request Method:POST Status Code:301 Moved Permanently Request Headersview source Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 Accept-Encoding:gzip,deflate,sdch Accept-Language:en-US,en;q=0.8,ru;q=0.6,bg;q=0.4,mn;q=0.2,nb;q=0.2 Cache-Control:no-cache Connection:keep

Unicorn stuck in loop: Refreshing Gem list

佐手、 提交于 2019-12-01 07:37:18
I'm using Rails 4.0.0, Ruby 2.3 and Unicorn. My app was working perfectly until the day I tried to add a nem gem in my Gemfile. Everything's working like a charm locally, but when I deploy to DO using Capistrano, I get stuck in a loop with the error: E, [2016-09-26T11:40:29.801388 #24545] ERROR -- : reaped #<Process::Status: pid 4280 exit 1> worker=0 I, [2016-09-26T11:40:29.802952 #4287] INFO -- : Refreshing Gem list /home/deployer/apps/my_app/shared/bundle/ruby/2.3.0/gems/activesupport-4.0.0/lib/active_support/values/time_zone.rb:282: warning: circular argument reference - now E, [2016-09

使用Unicorn,nginx,Capistrano 部署你的Rails 应用

Deadly 提交于 2019-12-01 06:15:53
http://rubysource.com/deploying-your-rails-app-to-the-cloud-with-unicorn-nginx-and-capistrano/ 配置你的服务器 你需要在你的服务器上安装Ruby的环境,你可以使用RVM或者是rbenv. 上传到github 这步需要将你的应用上传到github,在你的github上创建新的 repository,然后在你本机代码位置执行下面的命令,初始化git仓库。 git init git add . git commit -m "<message>" git remote add origin git@github.com:<username>/<git repo>.git git push origin master 安装Capistrano 在你的Gemfile里添加下面的一行。 gem 'capistrano' 然后执行 bundle 在你的项目目录里执行 capify . 执行结果 examination-paper ➤ capify . git:master* [add] writing './Capfile' [add] writing './config/deploy.rb' [done] capified! 创建了两个文件,你的Rails应用的配置文件写在config/deploy

Is it necessary to put Unicorn behind Nginx ( or Apache)

感情迁移 提交于 2019-12-01 03:18:36
I'm a bit confused about this architecture. On one of the projects I'm working on, Unicorn was chosen as a Rails server. And it is put behind Nginx web server. As I understand Unicorn is fully functional web server and we don't plan to host any other Rails applications on the same server instance. So my question would be: what are the benefits of having additional layer in chain: client -> nginx -> unicorn -> unicorn worker Unicorn was not designed to handle "slow clients". You can read more about this in the PHILOSOPHY help file: Most benchmarks we’ve seen don’t tell you this, and unicorn

Is it necessary to put Unicorn behind Nginx ( or Apache)

≡放荡痞女 提交于 2019-11-30 23:37:44
问题 I'm a bit confused about this architecture. On one of the projects I'm working on, Unicorn was chosen as a Rails server. And it is put behind Nginx web server. As I understand Unicorn is fully functional web server and we don't plan to host any other Rails applications on the same server instance. So my question would be: what are the benefits of having additional layer in chain: client -> nginx -> unicorn -> unicorn worker 回答1: Unicorn was not designed to handle "slow clients". You can read