PG::ConnectionBad: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory

Hey everyone! I have this issue for almost 3 weeks! Why?

I followed the tutorial you provided for Rails 7 deployment along with another tutorials for no help.

May 20 09:14:37 PM  ==> Cloning from https://github.com/nasserfq/shukran_me...
May 20 09:14:38 PM  ==> Checking out commit c1c281a8cacbe2e736dc36df6b4e09739babf596 in branch master
May 20 09:14:41 PM  ==> Downloading cache...
May 20 09:14:59 PM  ==> Running build command './bin/render-build.sh'...
May 20 09:15:00 PM  Using rake 13.0.6
May 20 09:15:00 PM  Using concurrent-ruby 1.2.2
May 20 09:15:00 PM  Using i18n 1.13.0
May 20 09:15:00 PM  Using minitest 5.18.0
May 20 09:15:00 PM  Using tzinfo 2.0.6
May 20 09:15:00 PM  Using activesupport 7.0.4.3
May 20 09:15:00 PM  Using builder 3.2.4
May 20 09:15:00 PM  Using erubi 1.12.0
May 20 09:15:00 PM  Using racc 1.6.2
May 20 09:15:00 PM  Using nokogiri 1.15.0 (x86_64-linux)
May 20 09:15:00 PM  Using rails-dom-testing 2.0.3
May 20 09:15:00 PM  Using crass 1.0.6
May 20 09:15:00 PM  Using loofah 2.21.3
May 20 09:15:00 PM  Using rails-html-sanitizer 1.5.0
May 20 09:15:00 PM  Using actionview 7.0.4.3
May 20 09:15:00 PM  Using rack 2.2.7
May 20 09:15:00 PM  Using rack-test 2.1.0
May 20 09:15:00 PM  Using actionpack 7.0.4.3
May 20 09:15:00 PM  Using nio4r 2.5.9
May 20 09:15:00 PM  Using websocket-extensions 0.1.5
May 20 09:15:00 PM  Using websocket-driver 0.7.5
May 20 09:15:00 PM  Using actioncable 7.0.4.3
May 20 09:15:00 PM  Using globalid 1.1.0
May 20 09:15:00 PM  Using activejob 7.0.4.3
May 20 09:15:00 PM  Using activemodel 7.0.4.3
May 20 09:15:00 PM  Using activerecord 7.0.4.3
May 20 09:15:00 PM  Using marcel 1.0.2
May 20 09:15:00 PM  Using mini_mime 1.1.2
May 20 09:15:00 PM  Using activestorage 7.0.4.3
May 20 09:15:00 PM  Using date 3.3.3
May 20 09:15:00 PM  Using timeout 0.3.2
May 20 09:15:00 PM  Using net-protocol 0.2.1
May 20 09:15:00 PM  Using net-imap 0.3.4
May 20 09:15:00 PM  Using net-pop 0.1.2
May 20 09:15:00 PM  Using net-smtp 0.3.3
May 20 09:15:00 PM  Using mail 2.8.1
May 20 09:15:00 PM  Using actionmailbox 7.0.4.3
May 20 09:15:00 PM  Using actionmailer 7.0.4.3
May 20 09:15:00 PM  Using actiontext 7.0.4.3
May 20 09:15:00 PM  Using ruby2_keywords 0.0.5
May 20 09:15:00 PM  Using arbre 1.5.0
May 20 09:15:00 PM  Using formtastic 4.0.0
May 20 09:15:00 PM  Using formtastic_i18n 0.7.0
May 20 09:15:00 PM  Using has_scope 0.8.1
May 20 09:15:00 PM  Using method_source 1.0.0
May 20 09:15:00 PM  Using thor 1.2.2
May 20 09:15:00 PM  Using zeitwerk 2.6.8
May 20 09:15:00 PM  Using railties 7.0.4.3
May 20 09:15:00 PM  Using responders 3.1.0
May 20 09:15:00 PM  Using inherited_resources 1.13.1
May 20 09:15:00 PM  Using jquery-rails 4.5.1
May 20 09:15:00 PM  Using kaminari-core 1.2.2
May 20 09:15:00 PM  Using kaminari-actionview 1.2.2
May 20 09:15:00 PM  Using kaminari-activerecord 1.2.2
May 20 09:15:00 PM  Using kaminari 1.2.2
May 20 09:15:00 PM  Using ransack 3.2.1
May 20 09:15:00 PM  Using activeadmin 2.13.1 from https://github.com/gregbell/active_admin.git
May 20 09:15:00 PM  Using bcrypt 3.1.18
May 20 09:15:00 PM  Using msgpack 1.7.0
May 20 09:15:00 PM  Using bootsnap 1.16.0
May 20 09:15:00 PM  Using ffi 1.15.5
May 20 09:15:00 PM  Using sassc 2.4.0
May 20 09:15:00 PM  Using bulma-rails 0.9.4
May 20 09:15:00 PM  Using bundler 2.4.12
May 20 09:15:00 PM  Using chunky_png 1.4.0
May 20 09:15:00 PM  Using colorize 0.8.1
May 20 09:15:00 PM  Using cssbundling-rails 1.1.2
May 20 09:15:00 PM  Using orm_adapter 0.5.0
May 20 09:15:00 PM  Using warden 1.2.9
May 20 09:15:00 PM  Using devise 4.8.1 from https://github.com/heartcombo/devise (at 6d32d24@6d32d24)
May 20 09:15:00 PM  Using dotenv 2.8.1
May 20 09:15:00 PM  Using dotenv-rails 2.8.1
May 20 09:15:00 PM  Using foreman 0.87.2
May 20 09:15:00 PM  Using friendly_id 5.5.0
May 20 09:15:00 PM  Using htmlbeautifier 1.4.2
May 20 09:15:00 PM  Using jbuilder 2.11.5
May 20 09:15:00 PM  Using moyasar 0.9.0
May 20 09:15:00 PM  Using name_of_person 1.1.1
May 20 09:15:00 PM  Using next_rails 1.2.4
May 20 09:15:00 PM  Using pg 1.5.3
May 20 09:15:00 PM  Using puma 6.2.2
May 20 09:15:00 PM  Using rails 7.0.4.3
May 20 09:15:00 PM  Using rqrcode_core 1.2.0
May 20 09:15:00 PM  Using rqrcode 2.1.2
May 20 09:15:00 PM  Using sprockets 4.2.0
May 20 09:15:00 PM  Using sprockets-rails 3.4.2
May 20 09:15:00 PM  Using tilt 2.1.0
May 20 09:15:00 PM  Using sassc-rails 2.1.2
May 20 09:15:00 PM  Using sass-rails 6.0.0
May 20 09:15:00 PM  Using securerandom 0.2.2
May 20 09:15:00 PM  Using simple_form 5.2.0
May 20 09:15:00 PM  Using tailwindcss-rails 2.0.29 (x86_64-linux)
May 20 09:15:00 PM  Using turbo-rails 1.4.0
May 20 09:15:00 PM  Using turbolinks-source 5.2.0
May 20 09:15:00 PM  Using turbolinks 5.2.1
May 20 09:15:00 PM  Bundle complete! 45 Gemfile dependencies, 95 gems now installed.
May 20 09:15:00 PM  Gems in the groups 'development' and 'test' were not installed.
May 20 09:15:00 PM  Bundled gems are installed into `/opt/render/project/.gems`
May 20 09:14:57 PM  ==> Transferred 159MB in 9s. Extraction took 5s.
May 20 09:15:05 PM  yarn install v1.22.19
May 20 09:15:05 PM  [1/4] Resolving packages...
May 20 09:15:05 PM  success Already up-to-date.
May 20 09:15:05 PM  Done in 0.66s.
May 20 09:15:05 PM  yarn run v1.22.19
May 20 09:15:05 PM  $ tailwindcss -i ./app/assets/stylesheets/application.tailwind.css -o ./app/assets/builds/application.css
May 20 09:15:06 PM  
May 20 09:15:06 PM  warn - The `content` option in your Tailwind CSS configuration is missing or empty.
May 20 09:15:06 PM  warn - Configure your content sources or your generated CSS will be missing styles.
May 20 09:15:06 PM  warn - https://tailwindcss.com/docs/content-configuration
May 20 09:15:06 PM  
May 20 09:15:06 PM  Done in 210ms.
May 20 09:15:06 PM  Done in 1.04s.
May 20 09:15:08 PM  
May 20 09:15:08 PM  Rebuilding...
May 20 09:15:09 PM  
May 20 09:15:09 PM  Done in 805ms.
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.844207 #115]  INFO -- : Writing /opt/render/project/src/public/assets/manifest-f5dd77899b3b44689945faaf3f7c0be77f34ab55bda66f03c6ff5b9f3a4d328f.js
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.844708 #115]  INFO -- : Writing /opt/render/project/src/public/assets/manifest-f5dd77899b3b44689945faaf3f7c0be77f34ab55bda66f03c6ff5b9f3a4d328f.js.gz
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.845185 #115]  INFO -- : Writing /opt/render/project/src/public/assets/logo_shukr_green-579590c1a6a0cc6753da84a7fc8cb1edb75a3d07e76cebeb1d7a7dd202f800a0.png
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.855180 #115]  INFO -- : Writing /opt/render/project/src/public/assets/application.tailwind-09133a095c1ce9d1f41d31415c048bf8fd45ad1327ca070f996b20b115482b43.css
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.855797 #115]  INFO -- : Writing /opt/render/project/src/public/assets/application.tailwind-09133a095c1ce9d1f41d31415c048bf8fd45ad1327ca070f996b20b115482b43.css.gz
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.856298 #115]  INFO -- : Writing /opt/render/project/src/public/assets/qrcode-ac8308cc5e12c61aaaf01f878f653039399cca6a1699d096dfe164ee3b4efa56.css
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.856543 #115]  INFO -- : Writing /opt/render/project/src/public/assets/qrcode-ac8308cc5e12c61aaaf01f878f653039399cca6a1699d096dfe164ee3b4efa56.css.gz
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.870534 #115]  INFO -- : Writing /opt/render/project/src/public/assets/scaffolds-73803e4d0bb56eb04ffd8e4d44fbafcf6b5c48fef99b47625d5ba101b34ed335.css
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.901942 #115]  INFO -- : Writing /opt/render/project/src/public/assets/scaffolds-73803e4d0bb56eb04ffd8e4d44fbafcf6b5c48fef99b47625d5ba101b34ed335.css.gz
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.902800 #115]  INFO -- : Writing /opt/render/project/src/public/assets/staffs-00ed377d45380be221e2fce90bfc1cf1fcb1bfb05f7e1791a9b5d167f96a47d7.css
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.904361 #115]  INFO -- : Writing /opt/render/project/src/public/assets/staffs-00ed377d45380be221e2fce90bfc1cf1fcb1bfb05f7e1791a9b5d167f96a47d7.css.gz
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.905542 #115]  INFO -- : Writing /opt/render/project/src/public/assets/static-6a9ca02cf939ae5b1b5a1f757b91a14f89083007ab6f4454afdda07e0c7d4535.css
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.906337 #115]  INFO -- : Writing /opt/render/project/src/public/assets/static-6a9ca02cf939ae5b1b5a1f757b91a14f89083007ab6f4454afdda07e0c7d4535.css.gz
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.906972 #115]  INFO -- : Writing /opt/render/project/src/public/assets/style-c66d65522b9d340bd196773b3aba9013c6ac4711b65340f26d699b6cd006490b.css
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.908508 #115]  INFO -- : Writing /opt/render/project/src/public/assets/style-c66d65522b9d340bd196773b3aba9013c6ac4711b65340f26d699b6cd006490b.css.gz
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.909492 #115]  INFO -- : Writing /opt/render/project/src/public/assets/user-5c8a0ee9fb482a315eb6e0fb4909ef52ba5044ed4d2436eb067e0d9c369e0861.css
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.910281 #115]  INFO -- : Writing /opt/render/project/src/public/assets/user-5c8a0ee9fb482a315eb6e0fb4909ef52ba5044ed4d2436eb067e0d9c369e0861.css.gz
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.910584 #115]  INFO -- : Writing /opt/render/project/src/public/assets/application-ad431081b21370e11eeca55bc96ab64752ec3821e51f4569898ff5d95ea87dfd.css
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.915061 #115]  INFO -- : Writing /opt/render/project/src/public/assets/application-ad431081b21370e11eeca55bc96ab64752ec3821e51f4569898ff5d95ea87dfd.css.gz
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.921326 #115]  INFO -- : Writing /opt/render/project/src/public/assets/tailwind-90b06bffa579d5a6fa5249553f049391a14d5c39c5eda032339d3f0e4b176bd5.css
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.924725 #115]  INFO -- : Writing /opt/render/project/src/public/assets/tailwind-90b06bffa579d5a6fa5249553f049391a14d5c39c5eda032339d3f0e4b176bd5.css.gz
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.925341 #115]  INFO -- : Writing /opt/render/project/src/public/assets/turbo-4851a9a0b1d947e810dfd0448a72aef261d455183ebea681f4f28a73640a9ece.js
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.925624 #115]  INFO -- : Writing /opt/render/project/src/public/assets/turbo-4851a9a0b1d947e810dfd0448a72aef261d455183ebea681f4f28a73640a9ece.js.gz
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.932996 #115]  INFO -- : Writing /opt/render/project/src/public/assets/turbo.min-f309baafa3ae5ad6ccee3e7362118b87678d792db8e8ab466c4fa284dd3a4700.js
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.934043 #115]  INFO -- : Writing /opt/render/project/src/public/assets/turbo.min-f309baafa3ae5ad6ccee3e7362118b87678d792db8e8ab466c4fa284dd3a4700.js.gz
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.934500 #115]  INFO -- : Writing /opt/render/project/src/public/assets/turbo.min.js-8bc8f4a58d1c106d58dec8bef6c638ff12ff4d078f19d8ebd8c4277f4c9bc85a.map
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.940015 #115]  INFO -- : Writing /opt/render/project/src/public/assets/turbo.min.js-8bc8f4a58d1c106d58dec8bef6c638ff12ff4d078f19d8ebd8c4277f4c9bc85a.map.gz
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.945297 #115]  INFO -- : Writing /opt/render/project/src/public/assets/actiontext-28c61f5197c204db043317a8f8826a87ab31495b741f854d307ca36122deefce.js
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.946075 #115]  INFO -- : Writing /opt/render/project/src/public/assets/actiontext-28c61f5197c204db043317a8f8826a87ab31495b741f854d307ca36122deefce.js.gz
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.947270 #115]  INFO -- : Writing /opt/render/project/src/public/assets/trix-1563ff9c10f74e143b3ded40a8458497eaf2f87a648a5cbbfebdb7dec3447a5e.js
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.947841 #115]  INFO -- : Writing /opt/render/project/src/public/assets/trix-1563ff9c10f74e143b3ded40a8458497eaf2f87a648a5cbbfebdb7dec3447a5e.js.gz
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.948563 #115]  INFO -- : Writing /opt/render/project/src/public/assets/trix-ac629f94e04ee467ab73298a3496a4dfa33ca26a132f624dd5475381bc27bdc8.css
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.949129 #115]  INFO -- : Writing /opt/render/project/src/public/assets/trix-ac629f94e04ee467ab73298a3496a4dfa33ca26a132f624dd5475381bc27bdc8.css.gz
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.951260 #115]  INFO -- : Writing /opt/render/project/src/public/assets/inter-font-8c3e82affb176f4bca9616b838d906343d1251adc8408efe02cf2b1e4fcf2bc4.css
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.958260 #115]  INFO -- : Writing /opt/render/project/src/public/assets/inter-font-8c3e82affb176f4bca9616b838d906343d1251adc8408efe02cf2b1e4fcf2bc4.css.gz
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.959882 #115]  INFO -- : Writing /opt/render/project/src/public/assets/Inter-italic.extra.var-cc59cf4b324781109d703309fc7d8814b6ba74dd2822a3c029715da8cb98ea57.woff2
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.962526 #115]  INFO -- : Writing /opt/render/project/src/public/assets/Inter-italic.alternates.var-cc59cf4b324781109d703309fc7d8814b6ba74dd2822a3c029715da8cb98ea57.woff2
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.963715 #115]  INFO -- : Writing /opt/render/project/src/public/assets/Inter-italic.symbols.var-59f27012284f5e97bbff303eb599ca98f29629a1c0fe7352bcc15b27d1dcd937.woff2
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.964796 #115]  INFO -- : Writing /opt/render/project/src/public/assets/Inter-italic.cyrillic.var-a31159d5ce68b317b19edc7ee7f1f3ffdd5316ee899945b502406abda313afa2.woff2
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.965757 #115]  INFO -- : Writing /opt/render/project/src/public/assets/Inter-italic.greek.var-77ec12f9397b88a29c16c05f2db87d9c0d0c2b157f1980271fed020f00b35321.woff2
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.966694 #115]  INFO -- : Writing /opt/render/project/src/public/assets/Inter-italic.vietnamese.var-b5dc5b6490ba49e8193315ff62c8e90551102055440f084a6e982e5eab8e589a.woff2
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.967338 #115]  INFO -- : Writing /opt/render/project/src/public/assets/Inter-italic.latin-ext.var-802705fb8496b82eda3f410c7e70a35c9407ba98b97cc5d9754db82750466fad.woff2
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.968069 #115]  INFO -- : Writing /opt/render/project/src/public/assets/Inter-italic.latin.var-cbfc0334f8cfad4727431982cd32c32f7daf6e73f0ab6f759ec3dc757c1c6bf7.woff2
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.969134 #115]  INFO -- : Writing /opt/render/project/src/public/assets/Inter-roman.extra.var-29781a209d7978155bf343eb1653779269965fa4a43d504b1fb361ab20e8487b.woff2
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.970103 #115]  INFO -- : Writing /opt/render/project/src/public/assets/Inter-roman.alternates.var-29781a209d7978155bf343eb1653779269965fa4a43d504b1fb361ab20e8487b.woff2
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.970817 #115]  INFO -- : Writing /opt/render/project/src/public/assets/Inter-roman.symbols.var-847d2a436a03ba1fbd4b750915db031a12a713befe0dcd79e8f39bf6a6e1a647.woff2
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.971165 #115]  INFO -- : Writing /opt/render/project/src/public/assets/Inter-roman.cyrillic.var-8aa524d3da3b8fd4a03ff2d0d41ea50520113fb2e8ae57c15079dabea44b3529.woff2
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.972504 #115]  INFO -- : Writing /opt/render/project/src/public/assets/Inter-roman.greek.var-1134a39060691474b0f57b2de5e09977a31a8c06df90960b982314f58a5b4c63.woff2
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.973612 #115]  INFO -- : Writing /opt/render/project/src/public/assets/Inter-roman.vietnamese.var-a10e650090dc30250de0db440654c9bf29a843b233ee95a699b008bab0a6d498.woff2
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.975067 #115]  INFO -- : Writing /opt/render/project/src/public/assets/Inter-roman.latin-ext.var-46bc23ba7e33ea447579cd95b95f34665d7560377065b72f3a77df8bca4b0e5c.woff2
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.976146 #115]  INFO -- : Writing /opt/render/project/src/public/assets/Inter-roman.latin.var-4b87a3d384ea557b10afa9570b753eda868b12b5e51eea0977ffa6e641998f6a.woff2
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.977052 #115]  INFO -- : Writing /opt/render/project/src/public/assets/activestorage-3ab61e47dd4ee2d79db525ade1dca2ede0ea2b7371fe587e408ee37b7ade265d.js
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.977475 #115]  INFO -- : Writing /opt/render/project/src/public/assets/activestorage-3ab61e47dd4ee2d79db525ade1dca2ede0ea2b7371fe587e408ee37b7ade265d.js.gz
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.978022 #115]  INFO -- : Writing /opt/render/project/src/public/assets/activestorage.esm-01f58a45d77495cdfbdfcc872902a430426c4391634ec9c3da5f69fbf8418492.js
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.978907 #115]  INFO -- : Writing /opt/render/project/src/public/assets/activestorage.esm-01f58a45d77495cdfbdfcc872902a430426c4391634ec9c3da5f69fbf8418492.js.gz
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.979515 #115]  INFO -- : Writing /opt/render/project/src/public/assets/actioncable-5433453f9b6619a9de91aaab2d7fc7ff183e5260c0107cbc9a1aa0c838d9a74e.js
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.980648 #115]  INFO -- : Writing /opt/render/project/src/public/assets/actioncable-5433453f9b6619a9de91aaab2d7fc7ff183e5260c0107cbc9a1aa0c838d9a74e.js.gz
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.988881 #115]  INFO -- : Writing /opt/render/project/src/public/assets/actioncable.esm-e01089c3ec4fe7817fa9abcad06cab6bdc387f95f0ca6aab4bf7ba7537f70690.js
May 20 09:15:09 PM  I, [2023-05-20T18:15:09.989367 #115]  INFO -- : Writing /opt/render/project/src/public/assets/actioncable.esm-e01089c3ec4fe7817fa9abcad06cab6bdc387f95f0ca6aab4bf7ba7537f70690.js.gz
May 20 09:15:14 PM  rails aborted!
May 20 09:15:14 PM  ActiveRecord::ConnectionNotEstablished: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
May 20 09:15:14 PM      Is the server running locally and accepting connections on that socket?
May 20 09:15:14 PM  
May 20 09:15:14 PM  
May 20 09:15:14 PM  Caused by:
May 20 09:15:14 PM  PG::ConnectionBad: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
May 20 09:15:14 PM      Is the server running locally and accepting connections on that socket?
May 20 09:15:14 PM  
May 20 09:15:14 PM  Tasks: TOP => db:migrate
May 20 09:15:14 PM  (See full trace by running task with --trace)
May 20 09:15:14 PM  ==> Build failed 😞

Thank you!

Hi,

You’ll need to check that your database details/setup. Rails usually expects a DATABASE_URL environment variable to be available with Postgres connection string. You’ll need to check that DATABASE_URL is defined and set to the “Internal Database URL” from the database page (also, the database & service need to be in the same region to use the internal connection).

Alan

This’s my database.yml

production:
  <<: *default
  database: new_database_name
  username: new_user
  url: <%= ENV['internal database'] %>
  password: <%= ENV['password'] %>

Created a new database with the same region

Created a new master.key and copy it and paste it into environment variables and this is the error I got below:

May 23 12:09:58 AM  rails aborted!
May 23 12:09:58 AM  ActiveSupport::MessageEncryptor::InvalidMessage: ActiveSupport::MessageEncryptor::InvalidMessage
May 23 12:09:58 AM  /opt/render/project/src/config/environment.rb:5:in `<main>'
May 23 12:09:58 AM  
May 23 12:09:58 AM  Caused by:
May 23 12:09:58 AM  OpenSSL::Cipher::CipherError:
May 23 12:09:58 AM  /opt/render/project/src/config/environment.rb:5:in `<main>'
May 23 12:09:58 AM  Tasks: TOP => environment
May 23 12:09:58 AM  (See full trace by running task with --trace)
May 23 12:09:58 AM  ==> Build failed 😞

This’s render.yaml file below

databases:
  - name: unique_name_instance # Creates a database named 'events'
    ipAllowList: [] # Only allow internal connections

services:
  - type: web
    name: sh
    env: ruby # The version is automatically picked up from a .ruby-version file
    buildCommand: "./bin/render-build.sh" # The script we just created above will run this to build our service
    startCommand: "./bin/rails server" # This gets called after build
    envVars:
      - key: DATABASE_URL
        fromDatabase:
          name: new_database_name
          property: connectionString # This is a pretty nifty feature of Render that utilizes the connection string from the database we specified at the beginning of this file.
      - key: RAILS_MASTER_KEY
        sync: false   

Screen Shot 2023-05-23 at 12.16.55 AM

I don’t know where is the error at?! Thank you

Your database.yml doesn’t look right:

url: <%= ENV['internal database'] %>password: <%= ENV['password'] %>

The url: is usually something like ENV['DATABASE_URL'] as you’ve shared in the render.yaml. That will include the password, so the additional password: attribute wouldn’t be needed.

The OpenSSL::Cipher::CipherError: sounds like it’s related to the credentials.yml, maybe you have the wrong master? Development & production master keys may be different, depending on how you set up your project.

Alan

I copied and paste Internal Database URL into url: <%= ENV['internal database'] 
and Password into password: <%= ENV['password'] %>

Are these the correct credentials?

For this reply below, can you elaborate? Because I delete and created a new master.key and credentials.yml.enc and then I copied what is in master.key file from config folder, this is its path config/master.key. And finally paste it into divorcement variables in Render.

The OpenSSL::Cipher::CipherError: sounds like it’s related to the credentials.yml, maybe you have the wrong master? Development & production master keys may be different, depending on how you set up your project.

Thank you

I’m not sure how to explain it any differently.

Set a DATABASE_URL Environment Variable on your Render service with the value given from the “Internal Database URL” of the database.

Then your database.yaml production config should just need to contain:

production: <<: *default url: <%= ENV['DATABASE_URL'] %>

Regarding the master key, you’ll need to ensure you’re using the correct key for your production config.

Alan

I think you don’t know the answer that’s why! I attached images and explain in detail but no answers to my problems!

Hi there,
I’m picking up this conversation from Al here.

All the details to solve this have been provided in this thread - it’s important to note that this is not a Render-specific issue; this is an application configuration issue.

Configuring Rails to use a database follows a similar pattern across most providers, a database.yml with a production attribute and the URL attribute set to use the environment variable eg:

production: 
     <<: *default
     url: <%= ENV['DATABASE_URL'] %> # ENTER THIS *EXACTLY* AS THIS, THIS READS THE VALUE OF THE DATABASE_URL environment variable programatically

And then provided you have DATABASE_URL set as an environment variable to a valid postgres connection string at runtime the Rails application will point at the correct database.

Regards,

John B
Render Support, UTC+1 :uk:

Thank you al_ps! I owe you an apology! I was frustrated and never thought it was that simple. Thank you again for trying to help.

Thank you John_B

# ENTER THIS *EXACTLY* AS THIS

This sentence is what made me gets it! it might’ve been due to the language barrier since English is not my native language. Thank you again! Regards

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.