Rails 6, Mysql, Ubuntu 20.04
I would like deploy with Capistrano Puma.
I have this error in my website :
We're sorry, but something went wrong.
If you are the application owner check the logs for more information.
Error into my log : puma.error.log :
/home/ubuntu/apps/appex/shared/bundle/ruby/3.0.0/gems/activestorage-
6.1.4.1/lib/active_storage/service/disk_service.rb:14:in `initialize': missing keyword: :root (ArgumentError)
from /home/ubuntu/apps/appex/shared/bundle/ruby/3.0.0/gems/activestorage-6.1.4.1/lib/active_storage/service.rb:61:in `new'
Log Nginx :
2021/11/16 10:05:02 [crit] 3361147#3361147: *6 connect() to unix:///home/ubuntu/apps/appex/shared/tmp/sockets/appex-puma.sock failed (2: No such file or directory) while connecting to upstream, client
That error comes from a misconfigured storage.yml in your environment. You are missing the root key.
For more information on how to set up ActiveStorage, read here.
Related
I am trying to synchronize data from my local dev database to a test DB running on Amazon RDS using the pgsync gem.
My .pgsync.yml page is simple:
from: postgres://localhost:5432/imports_development?sslmode=require
to: [See attempts below]
exclude:
- [A few tables]
I have tried many approaches but none of them are working. Here are all approaches and the error messages I've received:
to: postgres://awsuser:mypassword#imports-test.abcdefg.us-east-1.rds.amazonaws.com/postgres?sslca=config/rds-combined-ca-bundle.pem
=> invalid URI query parameter: "sslca"
to: postgres://awsuser:mypassword#imports-test.abcdefg.us-east-1.rds.amazonaws.com
=> connection to server at "52.4.150.10", port 5432 failed: FATAL: database "awsuser" does not exist
to: $(heroku config:get DATABASE_URL)
=> invalid URI parameter: "sslca"
to: imports-test.abcdefg.us-east-1.rds.amazonaws.com
=> connection to server on socket "/tmp/.s.PGSQL.5432" failed: FATAL: database "imports-test.abcdefg.us-east-1.rds.amazonaws.com" does not exist
These are the credentials used by database.yml for the RDS database:
rds_db_name: postgres
rds_username: awsuser
rds_password: mypassword
rds_hostname: imports-test.abcdefg.us-east-1.rds.amazonaws.com
rds_port: 5432
I can connect to both databases with rails console, so it should just be a matter of getting the above statements right. What is missing here?
Have you tried postgres://awsuser:mypassword#imports-test.abcdefg.us-east-1.rds.amazonaws.com/postgres ? Attempt no.2 seems to work, but doesn't include the DB name, based on the error.
Roughly the URI is in the format:
postgres://{USER}:{PASS}#{HOSTNAME}/{DBNAME}
The ?sslca=123 and other options AFTER ? (the query string) is meant as options. Not all clients support all options here.
My app is working fine on a local server. After deploying it on production (AWS EC2), I see this "classic" Rails error page:
I thought that the errors are logged to the file current/log/production.log, but when I looked in it, there's no error captured. I can only see there the following:
I, [2019-06-09T12:12:04.353438 #12855] INFO -- : Started GET "/constact-us" for 185.44.76.84 at 2019-06-09 12:12:04 +0000
I, [2019-06-09T12:12:04.355034 #12855] INFO -- : Processing by MyAppSite::SiteController#contact_us as HTML
There's logged accessing the URL, but not the error message. Where do I find it? I added some pure HTML/image to that template, so I think the error must be related to some issue with assets (and precompilation).
However, where do I find the full error message?
I am looking to the config/environments/production.rb file and regarding logs, there's "only" this line:
config.log_level = :info
Any advise how to figure out the error message?
EDIT: I just realized that I also have integrated Rollbar to the app and it hasn't caught the error either.
EDIT 2: error from the nginx log:
2019/06/09 13:47:14 [error] 987#0: *7824941 upstream prematurely closed connection while reading response header from upstream, client: IP, server: www.my_website.com, request: "GET /contact-us HTTP/1.1", upstream: "http://unix:/tmp/unicorn.myapp_production.sock:/contact-us", host: "www.my_website.com
Thank you
I've a site in Ruby on Rails hosted on DigitalOcean using mina deploy to deployment. I get deploy my application, but when I accessing my droplet by IP on Browser, I get the error:
We're sorry, but something went wrong.
I checked the unicorn log and it shows this:
root#marconportfa2018:~# tail -f /var/log/unicorn/unicorn.log
/home/nrt/shared/bundle/ruby/2.1.0/gems/rack-1.4.5/lib/rack/utils.rb:547: warning: already initialized constant Rack::Utils::STATUS_WITH_NO_ENTITY_BODY
/usr/local/rvm/gems/ruby-2.1.1/gems/rack-1.4.5/lib/rack/utils.rb:547: warning: previous definition of STATUS_WITH_NO_ENTITY_BODY was here
/home/nrt/shared/bundle/ruby/2.1.0/gems/rack-1.4.5/lib/rack/utils.rb:549: warning: already initialized constant Rack::Utils::SYMBOL_TO_STATUS_CODE
/usr/local/rvm/gems/ruby-2.1.1/gems/rack-1.4.5/lib/rack/utils.rb:549: warning: previous definition of SYMBOL_TO_STATUS_CODE was here
/home/nrt/shared/bundle/ruby/2.1.0/gems/rack-1.4.5/lib/rack/utils.rb:562: warning: already initialized constant Rack::Utils::Multipart
/usr/local/rvm/gems/ruby-2.1.1/gems/rack-1.4.5/lib/rack/utils.rb:562: warning: previous definition of Multipart was here
[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
I, [2018-04-16T20:53:27.589122 #26924] INFO -- : worker=1 ready
I, [2018-04-16T20:53:27.590074 #26922] INFO -- : worker=0 ready
And I checked the nginx error.log to:
root#marconportfa2018:/var/log/nginx# tail -f error.log
2018/04/16 07:09:26 [crit] 1226#0: *1 connect() to unix:/var/run/unicorn.sock failed (2: No such file or directory) while connecting to upstream, client: 177.183.110.26, server: _, request: "GET / HTTP/1.1", upstream: "http://unix:/var/run/unicorn.sock:/", host: "159.65.75.62"
.ruby-version
2.1.3#marconPortfa
Someone can help me?
I just deployed my site on AWS Elasticbeanstalk. Im using postgres, puma, paperclip. For some odd reason when I try to edit my profile "using devise" and change the photo to another photo and click submit I get an error: "The connection was reset" I really have no clue to why this is!! How can I change a photo??? Thank you!!
I have this log however that shows only what happens when trying to view the photo that i selected in the first place. From what my nginx/error.log shows is that the file size "picture" that i try to add is too large.. so how can I fix this?? I followed a response to this by adding folder called .ebextensions with a file called 01_files.config
01_files.config
files:
"/etc/nginx/conf.d/proxy.conf" :
mode: "000755"
owner: root
group: root
content: |
http {
client_max_body_size 20M;
}
/var/log/nginx/error.log
2016/06/04 03:34:01 [warn] 15075#0: conflicting server name "localhost" on 0.0.0.0:80, ignored
2016/06/04 03:56:42 [error] 2805#0: *23810 client intended to send too large body: 2771639 bytes, client: 172.31.36.95, server: _, request: "POST / HTTP/1.1", host:
Error Log:
I, [2016-06-04T03:15:39.389493 #14337] INFO -- : Started GET "/system/users/avatars/000/000/008/thumb/IMG_0645.JPG?1465010122" for 221.146.103.246 at 2016-06-04 03:15:39 +0000
F, [2016-06-04T03:15:39.391271 #14337] FATAL -- :
ActionController::RoutingError (No route matches [GET] "/system/users/avatars/000/000/008/thumb/IMG_0645.JPG"):
I tried to search by the following criteria:
imap_search($this->box, 'FROM "#avito.ru"');
And I faced with such problem:
2013/03/03 11:24:23 [error] 12481#0: *102 FastCGI sent in stderr: "PHP message: PHP Notice: Unknown: NOT IMPLEMENTED (errflg=2) in Unknown on line 0" while reading upstream, client: 9*.2*6.1*9.18*, server: 1*6.1*.1*8.*3, request: "GET /testmail.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "r*****ger.ru"
What you should do is check whether it is an IMAP issue or a PHP issue. Try connecting to the IMAP server manually using telnet (or, if the server uses SSL and you're on Windows, something like my IMAPTalk client will be necessary).
Login and select the folder (done automatically in IMAPTalk if you supply the credentials and folder name in the login window), and then enter your search command, such as:
01 SEARCH FROM "#avito.ru"
See what the response is. If you get an error at this point, you know it's a problem with the IMAP server.
I would also suggest trying the query without quotes, i.e.
01 SEARCH FROM #avito.ru