ankane / pghero

A performance dashboard for Postgres
MIT License
8.16k stars 452 forks source link

Fail to start if password contain @ #31

Closed Hubbitus closed 8 years ago

Hubbitus commented 9 years ago
[25722] ! Unable to load application: URI::InvalidURIError: the scheme postgres does not accept registry part: postgres:H!HxDu3dg07@3Mg@egais.perf.db.master:5432 (or bad hostname?)
/opt/pghero/vendor/ruby-2.0.0/lib/ruby/2.0.0/uri/generic.rb:214:in `initialize': the scheme postgres does not accept registry part: postgres:F!#D3vds056@3%g@egais.perf.db.master:5432 (or bad hostname?) (URI::InvalidURIError)
        from /opt/pghero/vendor/ruby-2.0.0/lib/ruby/2.0.0/uri/common.rb:218:in `new'
        from /opt/pghero/vendor/ruby-2.0.0/lib/ruby/2.0.0/uri/common.rb:218:in `parse'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.3/lib/active_record/connection_adapters/connection_specification.rb:36:in `initialize'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.3/lib/active_record/connection_adapters/connection_specification.rb:270:in `new'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.3/lib/active_record/connection_adapters/connection_specification.rb:270:in `resolve_url_connection'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.3/lib/active_record/connection_adapters/connection_specification.rb:258:in `resolve_hash_connection'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.3/lib/active_record/connection_adapters/connection_specification.rb:215:in `resolve_connection'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.3/lib/active_record/connection_adapters/connection_specification.rb:139:in `resolve'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.3/lib/active_record/connection_adapters/connection_specification.rb:151:in `block in resolve_all'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.3/lib/active_record/connection_adapters/connection_specification.rb:150:in `each'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.3/lib/active_record/connection_adapters/connection_specification.rb:150:in `resolve_all'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.3/lib/active_record/connection_handling.rb:69:in `resolve'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.3/lib/active_record/core.rb:46:in `configurations='
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.3/lib/active_record/core.rb:48:in `block in <module:Core>'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.3/lib/active_support/concern.rb:120:in `class_eval'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.3/lib/active_support/concern.rb:120:in `append_features'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.3/lib/active_record/base.rb:284:in `include'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.3/lib/active_record/base.rb:284:in `<class:Base>'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.3/lib/active_record/base.rb:269:in `<module:ActiveRecord>'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.3/lib/active_record/base.rb:26:in `<top (required)>'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/pghero-1.1.0/lib/pghero.rb:8:in `<module:PgHero>'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/pghero-1.1.0/lib/pghero.rb:6:in `<top (required)>'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/bundler-1.7.12/lib/bundler/runtime.rb:76:in `require'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/bundler-1.7.12/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/bundler-1.7.12/lib/bundler/runtime.rb:72:in `each'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/bundler-1.7.12/lib/bundler/runtime.rb:72:in `block in require'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/bundler-1.7.12/lib/bundler/runtime.rb:61:in `each'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/bundler-1.7.12/lib/bundler/runtime.rb:61:in `require'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/bundler-1.7.12/lib/bundler.rb:134:in `require'
        from /opt/pghero/config/application.rb:2:in `<top (required)>'
        from /opt/pghero/config/environment.rb:2:in `require'
        from /opt/pghero/config/environment.rb:2:in `<top (required)>'
        from config.ru:3:in `require'
        from config.ru:3:in `block in <main>'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in `instance_eval'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in `initialize'
        from config.ru:in `new'
        from config.ru:in `<main>'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in `eval'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in `new_from_string'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/rack-1.6.4/lib/rack/builder.rb:40:in `parse_file'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/puma-2.11.3/lib/puma/configuration.rb:102:in `load_rackup'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/puma-2.11.3/lib/puma/configuration.rb:69:in `app'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/puma-2.11.3/lib/puma/runner.rb:113:in `load_and_bind'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/puma-2.11.3/lib/puma/cluster.rb:302:in `run'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/puma-2.11.3/lib/puma/cli.rb:216:in `run'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/puma-2.11.3/bin/puma:10:in `<top (required)>'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/bin/puma:23:in `load'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/bin/puma:23:in `<main>'
thotmx commented 8 years ago

@Hubbitus I think, this would help: http://superuser.com/questions/273799/how-to-use-special-characters-in-username-password-for-http-proxy

Hubbitus commented 8 years ago

@thotmx, I unsure, but it is for windows cmd. Why it should help there in config file??

thotmx commented 8 years ago

postgres:H!HxDu3dg07@3Mg@egais.perf.db.master:5432

This would fail parsing the URI.

I think using %40 instead @ would solve the problem.

Hubbitus commented 8 years ago

Even if I have URL without @:

$ cat /etc/pghero/conf.d/other
export DATABASE_URL="postgres://postgres:pas!s@localhost:54321/egais"
$ cat /var/log/pghero/web-1.log
[25598] Puma starting in cluster mode...
[25598] * Version 2.15.3 (ruby 2.0.0-p648), codename: Autumn Arbor Airbrush
[25598] * Min threads: 1, max threads: 16
[25598] * Environment: production
[25598] * Process workers: 3
[25598] * Preloading application
[25598] ! Unable to load application: NameError: uninitialized constant ActionView::Helpers::ActiveModelHelper
/opt/pghero/vendor/bundle/ruby/2.0.0/gems/actionview-4.2.5/lib/action_view/helpers.rb:40:in `<module:Helpers>': uninitialized constant ActionView::Helpers::ActiveModelHelper
 (NameError)
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/actionview-4.2.5/lib/action_view/helpers.rb:4:in `<module:ActionView>'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/actionview-4.2.5/lib/action_view/helpers.rb:3:in `<top (required)>'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/actionview-4.2.5/lib/action_view/base.rb:5:in `<top (required)>'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/actionview-4.2.5/lib/action_view/view_paths.rb:1:in `<top (required)>'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/actionpack-4.2.5/lib/abstract_controller/rendering.rb:4:in `<top (required)>'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/actionpack-4.2.5/lib/action_controller/base.rb:204:in `<class:Base>'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/actionpack-4.2.5/lib/action_controller/base.rb:164:in `<module:ActionController>'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/actionpack-4.2.5/lib/action_controller/base.rb:5:in `<top (required)>'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/pghero-1.2.2/app/controllers/pg_hero/home_controller.rb:2:in `<module:PgHero>'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/pghero-1.2.2/app/controllers/pg_hero/home_controller.rb:1:in `<top (required)>'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/railties-4.2.5/lib/rails/engine.rb:472:in `block (2 levels) in eager_load!'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/railties-4.2.5/lib/rails/engine.rb:471:in `each'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/railties-4.2.5/lib/rails/engine.rb:471:in `block in eager_load!'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/railties-4.2.5/lib/rails/engine.rb:469:in `each'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/railties-4.2.5/lib/rails/engine.rb:469:in `eager_load!'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/railties-4.2.5/lib/rails/engine.rb:346:in `eager_load!'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/railties-4.2.5/lib/rails/application/finisher.rb:56:in `each'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/railties-4.2.5/lib/rails/application/finisher.rb:56:in `block in <module:Finisher>'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/railties-4.2.5/lib/rails/initializable.rb:30:in `instance_exec'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/railties-4.2.5/lib/rails/initializable.rb:30:in `run'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/railties-4.2.5/lib/rails/initializable.rb:55:in `block in run_initializers'
        from /opt/pghero/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:150:in `block in tsort_each'
        from /opt/pghero/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
        from /opt/pghero/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:219:in `each_strongly_connected_component_from'
        from /opt/pghero/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:182:in `block in each_strongly_connected_component'
        from /opt/pghero/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:180:in `each'
        from /opt/pghero/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:180:in `each_strongly_connected_component'
        from /opt/pghero/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:148:in `tsort_each'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/railties-4.2.5/lib/rails/initializable.rb:54:in `run_initializers'
        from /opt/pghero/vendor/bundle/ruby/2.0.0/gems/railties-4.2.5/lib/rails/application.rb:352:in `initialize!'
        from /opt/pghero/config/environment.rb:5:in `<top (required)>'
        from config.ru:3:in `require'
Hubbitus commented 8 years ago

Why you close it? Does pghero at all ready to use and should work?

ankane commented 8 years ago

Sorry @Hubbitus, the issue in the title was resolved. Can you create a new issue for the 2nd error if you're still seeing it?

Hubbitus commented 8 years ago

Ok, you just do not provide rpms fro fresh Fedora versions. I able to use it from docker container nowe. Thanks.