The user helmi is experiencing a Postgres connection error when running bundle exec rails c. JammyDodger suggests using cd /var/discourse, ./launcher enter app, and then rails c to access the rails console.
After accessing the console, helmi tries to change the IP regex for the Prometheus exporter plugin but encounters a syntax issue. helmi realizes it’s not a syntax issue and asks for help from sam.
Falco explains that the setting must be configured as an environment variable DISCOURSE_PROMETHEUS_TRUSTED_IP_ALLOWLIST_REGEX in the app.yml file. helmi asks for clarification on the syntax and whether runtime changes are possible.
Falco confirms that only environment variable changes are allowed, not runtime changes, and provides a link to Ruby Regex documentation. The correct syntax for the environment variable is indeed DISCOURSE_PROMETHEUS_TRUSTED_IP_ALLOWLIST_REGEX: 123.145.167.189.
I’m trying to change some forum settings through the console. I didn’t do that a lot yet so I searched for similar questions on the forum.
Unfortunately when executing ‘bundle exec rails c’ i get an error trace that ends with this line
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.4.7/lib/active_record/connection_adapters/postgresql_adapter.rb:81:in `rescue in new_client': connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: Peer authentication failed for user "discourse" (ActiveRecord::NoDatabaseError)
Any idea what’s going on there? Forum itself runs fine - just updated to the latest version the other day.
SiteSetting.prometheus_trusted_ip_allowlist_regex=1.2.3.4 with escaping backslashes and quotes around it but nothing worked. 1.2.3.4 being a placeholder of my real IP.