chiperific
chiperific
RRailway
Created by chiperific on 2/5/2024 in #✋|help
PG::ConnectionBad: connection to server at "34.105.6.235", port 6449 failed: Connection refused
One of my 3 applications is failing. I did migrate the data successfully on all 3 applications. Logs for worker and web both say: PG::ConnectionBad: connection to server at "34.105.6.235", port 6449 failed: Connection refused Tried restarting Postgres:
2024-02-05 22:05:23.269 UTC [8] LOG: starting PostgreSQL 15.4 (Ubuntu 15.4-2.pgdg22.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, 64-bit
2024-02-05 22:05:23.269 UTC [8] LOG: listening on IPv4 address "0.0.0.0", port 5432
2024-02-05 22:05:23.269 UTC [8] LOG: listening on IPv6 address "::", port 5432
2024-02-05 22:05:23.282 UTC [8] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2024-02-05 22:05:23.287 UTC [35] LOG: database system was interrupted; last known up at 2024-02-05 21:59:58 UTC
2024-02-05 22:05:23.331 UTC [35] LOG: database system was not properly shut down; automatic recovery in progress
2024-02-05 22:05:23.334 UTC [35] LOG: redo starts at 0/2ED0A08
2024-02-05 22:05:23.334 UTC [35] LOG: invalid record length at 0/2ED0AF0: wanted 24, got 0
2024-02-05 22:05:23.334 UTC [35] LOG: redo done at 0/2ED0AB8 system usage: CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.00 s
2024-02-05 22:05:23.338 UTC [33] LOG: checkpoint starting: end-of-recovery immediate wait
2024-02-05 22:05:23.348 UTC [33] LOG: checkpoint complete: wrote 3 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.003 s, sync=0.002 s, total=0.012 s; sync files=2, longest=0.001 s, average=0.001 s; distance=0 kB, estimate=0 kB
2024-02-05 22:05:23.355 UTC [8] LOG: database system is ready to accept connections
2024-02-05 22:05:23.356 UTC [38] LOG: TimescaleDB background worker launcher connected to shared catalogs
2024-02-05 22:05:23.269 UTC [8] LOG: starting PostgreSQL 15.4 (Ubuntu 15.4-2.pgdg22.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, 64-bit
2024-02-05 22:05:23.269 UTC [8] LOG: listening on IPv4 address "0.0.0.0", port 5432
2024-02-05 22:05:23.269 UTC [8] LOG: listening on IPv6 address "::", port 5432
2024-02-05 22:05:23.282 UTC [8] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2024-02-05 22:05:23.287 UTC [35] LOG: database system was interrupted; last known up at 2024-02-05 21:59:58 UTC
2024-02-05 22:05:23.331 UTC [35] LOG: database system was not properly shut down; automatic recovery in progress
2024-02-05 22:05:23.334 UTC [35] LOG: redo starts at 0/2ED0A08
2024-02-05 22:05:23.334 UTC [35] LOG: invalid record length at 0/2ED0AF0: wanted 24, got 0
2024-02-05 22:05:23.334 UTC [35] LOG: redo done at 0/2ED0AB8 system usage: CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.00 s
2024-02-05 22:05:23.338 UTC [33] LOG: checkpoint starting: end-of-recovery immediate wait
2024-02-05 22:05:23.348 UTC [33] LOG: checkpoint complete: wrote 3 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.003 s, sync=0.002 s, total=0.012 s; sync files=2, longest=0.001 s, average=0.001 s; distance=0 kB, estimate=0 kB
2024-02-05 22:05:23.355 UTC [8] LOG: database system is ready to accept connections
2024-02-05 22:05:23.356 UTC [38] LOG: TimescaleDB background worker launcher connected to shared catalogs
And restarting my apps, but same message. Project #: 9ddc4dfb-ab3f-4809-8481-9657a0c52a43
8 replies
RRailway
Created by chiperific on 4/19/2023 in #✋|help
CLI: `railway shell` has ENV variables, but not accessible in Rails?
> railway shell
Entering subshell with Railway variables available. Type 'exit' to exit.
> railway variables
╔══════════════════════════════ Variables for web ═════════════════════════════╗
...(all the vars are here as expected, including SMTP_USER)...
╚══════════════════════════════════════════════════════════════════════════════╝
> echo $RAILS_ENV
production
> rails c
... `fetch': key not found: "SMTP_USER" (KeyError)
> railway shell
Entering subshell with Railway variables available. Type 'exit' to exit.
> railway variables
╔══════════════════════════════ Variables for web ═════════════════════════════╗
...(all the vars are here as expected, including SMTP_USER)...
╚══════════════════════════════════════════════════════════════════════════════╝
> echo $RAILS_ENV
production
> rails c
... `fetch': key not found: "SMTP_USER" (KeyError)
The code in production.rb that is erroring out is user_name: ENV.fetch('SMTP_USER') Any ideas?
4 replies
RRailway
Created by chiperific on 1/16/2023 in #✋|help
Getting "Nothing here yet" first time visiting URL
App ID: 87b0bd8e-62e9-4f8a-ba89-ea0ae1afc203 The site has been up for a month and DNS settings are working However, the first time a person visits the URL (https://gen1parenting.com) they get the "Nothing Here, Yet" message with the Railway logo. Stranger still, I have several domains that redirect to this one. If you visit https://gen1parenting.org, you get redirected to https://gen1parenting.com and the site loads just fine. Once they've reached the site via a redirect, the main URL loads fine.
10 replies
RRailway
Created by chiperific on 11/10/2022 in #✋|help
Rails app logs are delayed ~3 minutes in dashboard, don't stream to CLI
App: e0cf682e-3491-4309-b018-e3f50c9eba10 Running railway logs in CLI pulls logs (no timestamps, though), but doesn't seem to stream new log entries in. I have to kill the shell and run the command again. Even then it seems to be about 3 minutes behind. Using the dashboard view, with timestamps on, I do see new log entries appear in batches, but still ~3 minutes behind live actions. Is this expected behavior?
5 replies
RRailway
Created by chiperific on 11/2/2022 in #✋|help
RVM gemset breaks Nix or Docker
Ruby on Rails 7 app. I have a /.ruby-version file that RVM uses to set defaults When no gemset is indicated, Railway builds the app just fine. But if I indicate one, deploy fails.
╔═════════════════════════ Nixpacks v0.11.5 ══════════════════╗
║ setup │ pkgs: procps, libpq-dev ║
║ │ cmds: curl -sSL https://get.rvm.io | bash -s stable && .║
║ │ /etc/profile.d/rvm.sh ║
║ │ rvm install ruby-3.1.2@liters_tracker ║
║ │ rvm --default use ruby-3.1.2@liters_tracker ║
║ │ gem install bundler:2.3.6 ║
║ │ echo 'source /usr/local/rvm/scripts/rvm' >> /root/.profile
...
#11 [stage-0 7/19] RUN rvm install ruby-3.1.2@liters_tracker
...

#11 0.719 Warning! PATH is not properly set up, /usr/local/rvm/gems/ruby-3.1.2@liters_tracker/bin is not available.
...
#11 116.0 ruby-3.1.2 - #gemset created /usr/local/rvm/gems/ruby-3.1.2@global

#11 116.1 ruby-3.1.2 - #importing gemset /usr/local/rvm/gemsets/global.gems
..........................................................

#11 118.8 ruby-3.1.2 - #generating global wrappers
........
#11 119.4 ruby-3.1.2 - #gemset created /usr/local/rvm/gems/ruby-3.1.2

#11 119.5 ruby-3.1.2 - #importing gemsetfile /usr/local/rvm/gemsets/default.gems evaluated to empty gem list
#11 119.5 ruby-3.1.2 - #generating default wrappers
...
#11 120.8 Gemset 'liters_tracker' does not exist, 'rvm ruby-3.1.2 do rvm gemset create liters_tracker' first, or append '--create'.

#11 ERROR: executor failed running [/bin/bash -ol pipefail -c rvm install ruby-3.1.2@liters_tracker]: exit code: 2
-----
> [stage-0 7/19] RUN rvm install ruby-3.1.2@liters_tracker:
-----
executor failed running [/bin/bash -ol pipefail -c rvm install ruby-3.1.2@liters_tracker]: exit code: 2

Error: Docker build failed
╔═════════════════════════ Nixpacks v0.11.5 ══════════════════╗
║ setup │ pkgs: procps, libpq-dev ║
║ │ cmds: curl -sSL https://get.rvm.io | bash -s stable && .║
║ │ /etc/profile.d/rvm.sh ║
║ │ rvm install ruby-3.1.2@liters_tracker ║
║ │ rvm --default use ruby-3.1.2@liters_tracker ║
║ │ gem install bundler:2.3.6 ║
║ │ echo 'source /usr/local/rvm/scripts/rvm' >> /root/.profile
...
#11 [stage-0 7/19] RUN rvm install ruby-3.1.2@liters_tracker
...

#11 0.719 Warning! PATH is not properly set up, /usr/local/rvm/gems/ruby-3.1.2@liters_tracker/bin is not available.
...
#11 116.0 ruby-3.1.2 - #gemset created /usr/local/rvm/gems/ruby-3.1.2@global

#11 116.1 ruby-3.1.2 - #importing gemset /usr/local/rvm/gemsets/global.gems
..........................................................

#11 118.8 ruby-3.1.2 - #generating global wrappers
........
#11 119.4 ruby-3.1.2 - #gemset created /usr/local/rvm/gems/ruby-3.1.2

#11 119.5 ruby-3.1.2 - #importing gemsetfile /usr/local/rvm/gemsets/default.gems evaluated to empty gem list
#11 119.5 ruby-3.1.2 - #generating default wrappers
...
#11 120.8 Gemset 'liters_tracker' does not exist, 'rvm ruby-3.1.2 do rvm gemset create liters_tracker' first, or append '--create'.

#11 ERROR: executor failed running [/bin/bash -ol pipefail -c rvm install ruby-3.1.2@liters_tracker]: exit code: 2
-----
> [stage-0 7/19] RUN rvm install ruby-3.1.2@liters_tracker:
-----
executor failed running [/bin/bash -ol pipefail -c rvm install ruby-3.1.2@liters_tracker]: exit code: 2

Error: Docker build failed
step #11 116.0 shows a global gemset getting created. Is there a way to override this?
11 replies
RRailway
Created by chiperific on 9/28/2022 in #✋|help
Magic login service down?
8 replies
RRailway
Created by chiperific on 9/28/2022 in #✋|help
Procfile with web & worker should create two services, right?
Rails 6 app with this Procfile:
web: /bin/bash -l -c "rails db:migrate && bundle exec puma -C config/puma.rb"
worker: /bin/bash -l -c "bundle exec sidekiq -C config/sidekiq.yml"
web: /bin/bash -l -c "rails db:migrate && bundle exec puma -C config/puma.rb"
worker: /bin/bash -l -c "bundle exec sidekiq -C config/sidekiq.yml"
I added PostgreSQL service and Redis service Then I add Github repo. Only one service appears and start of Build logs looks like this:
╔═══════════════════════════════ Nixpacks v0.6.2 ══════════════════════════════╗
║ setup │ pkgs: procps, libpq-dev
║ │ cmds: curl -sSL https://get.rvm.io | bash -s stable && .
║ │ /etc/profile.d/rvm.sh
║ │ rvm install 3.1.2
║ │ rvm --default use 3.1.2
║ │ gem install bundler:2.3.17
║ │ echo 'source /usr/local/rvm/scripts/rvm' >> /root/.profile
║─────────────────────────────
║ node:setup │ nodejs-16_x, npm-8_x
║─────────────────────────────
║ node:install │ npm i
║──────────────────────────────
║ install │ bundle install
║───────────────────────────────
║ build │ bundle exec rake assets:precompile
║───────────────────────────────
║ start │ /bin/bash -l -c "bundle exec sidekiq -C config/sidekiq.yml"
╔═══════════════════════════════ Nixpacks v0.6.2 ══════════════════════════════╗
║ setup │ pkgs: procps, libpq-dev
║ │ cmds: curl -sSL https://get.rvm.io | bash -s stable && .
║ │ /etc/profile.d/rvm.sh
║ │ rvm install 3.1.2
║ │ rvm --default use 3.1.2
║ │ gem install bundler:2.3.17
║ │ echo 'source /usr/local/rvm/scripts/rvm' >> /root/.profile
║─────────────────────────────
║ node:setup │ nodejs-16_x, npm-8_x
║─────────────────────────────
║ node:install │ npm i
║──────────────────────────────
║ install │ bundle install
║───────────────────────────────
║ build │ bundle exec rake assets:precompile
║───────────────────────────────
║ start │ /bin/bash -l -c "bundle exec sidekiq -C config/sidekiq.yml"
I can see "start" has the 2nd line of my Procfile and if I let it go fully, I have a Sidekiq process running, but not a Puma server. The only issue I can think of is I'm not deploying from master, I have a separate branch on my repo called railway and after the service is connected, I abort the first deploy from master and switch it over to the railway branch. Could this be causing the issue as it reads from the master branch initially?
10 replies
RRailway
Created by chiperific on 9/27/2022 in #✋|help
HEROKU transfer pg_restore error could not execute query ERROR role b1ahbl4h does not exist
Following the instructions from the Postgres Backup and Restore guide (https://blog.railway.app/p/postgre-backup). Neither the general nor Heroku-specific instructions were working for me. I keep getting the same error 37 times:
pg_restore: while PROCESSING TOC:
pg_restore: from TOC entry 201; 1259 26716 TABLE active_storage_attachments bjgcpazvgytpjw
pg_restore: error: could not execute query: ERROR: role "bjgcpazvgytpjw" does not exist
Command was: ALTER TABLE public.active_storage_attachments OWNER TO bjgcpazvgytpjw;

pg_restore: from TOC entry 202; 1259 26731 SEQUENCE active_storage_attachments_id_seq bjgcpazvgytpjw
pg_restore: error: could not execute query: ERROR: role "bjgcpazvgytpjw" does not exist
Command was: ALTER TABLE public.active_storage_attachments_id_seq OWNER TO bjgcpazvgytpjw;

pg_restore: from TOC entry 203; 1259 26736 TABLE active_storage_blobs bjgcpazvgytpjw
pg_restore: error: could not execute query: ERROR: role "bjgcpazvgytpjw" does not exist
Command was: ALTER TABLE public.active_storage_blobs OWNER TO bjgcpazvgytpjw;
...
pg_restore: while PROCESSING TOC:
pg_restore: from TOC entry 201; 1259 26716 TABLE active_storage_attachments bjgcpazvgytpjw
pg_restore: error: could not execute query: ERROR: role "bjgcpazvgytpjw" does not exist
Command was: ALTER TABLE public.active_storage_attachments OWNER TO bjgcpazvgytpjw;

pg_restore: from TOC entry 202; 1259 26731 SEQUENCE active_storage_attachments_id_seq bjgcpazvgytpjw
pg_restore: error: could not execute query: ERROR: role "bjgcpazvgytpjw" does not exist
Command was: ALTER TABLE public.active_storage_attachments_id_seq OWNER TO bjgcpazvgytpjw;

pg_restore: from TOC entry 203; 1259 26736 TABLE active_storage_blobs bjgcpazvgytpjw
pg_restore: error: could not execute query: ERROR: role "bjgcpazvgytpjw" does not exist
Command was: ALTER TABLE public.active_storage_blobs OWNER TO bjgcpazvgytpjw;
...
The article section on pg_restore specific to Heroku (https://blog.railway.app/p/postgre-backup#heroku-specific-instructions) doesn't seem to actually differ from the general pg_restore method. Could the issue be that the article is missing the --no-owner flag? To test, I ran this: pg_restore -U postgres -h containers-us-west-##.railway.app -p 7180 -W -F t --no-owner -d railway latest.dump And it worked. Is this correct? If so, should the article be updated?
5 replies