heroku / legacy-cli

Heroku CLI
https://cli.heroku.com
MIT License
1.37k stars 380 forks source link

$heroku pg:reset DATABASE gives Error: undefined method `map' for #<String:0x00000004170fd0> (NoMethodError) #1902

Open soniacaan opened 8 years ago

soniacaan commented 8 years ago

I am new to this, so not sure where to start to fix this issue. I also noticed that database fields on my local DB are not reflected in Postgres DB in Heroku.

$heroku pg:reset DATABASE above command gives an error message

 !    Heroku client internal error.
 !    Search for help at: https://help.heroku.com
 !    Or report a bug at: https://github.com/heroku/heroku/issues/new

    Error:       undefined method `map' for #<String:0x00000004170fd0> (NoMethodError)
    Command:     heroku pg:reset DATABASE
    Version:     heroku/toolbelt/3.42.36 (x64-mingw32) ruby/2.2.4
    Error ID:    0e03c3c6dc824278a6ea5e76288d6bae

error.log

Heroku client internal error.
No application found to handle 'web_url'
C:/Program Files (x86)/Heroku/vendor/gems/launchy-2.4.3/lib/launchy/application.rb:24:in `handling'
C:/Program Files (x86)/Heroku/vendor/gems/launchy-2.4.3/lib/launchy.rb:43:in `app_for_uri'
C:/Program Files (x86)/Heroku/vendor/gems/launchy-2.4.3/lib/launchy.rb:28:in `open'
C:/Program Files (x86)/Heroku/lib/heroku/helpers.rb:389:in `block in launchy'
C:/Program Files (x86)/Heroku/lib/heroku/helpers.rb:280:in `action'
C:/Program Files (x86)/Heroku/lib/heroku/helpers.rb:387:in `launchy'
C:/Program Files (x86)/Heroku/lib/heroku/command/apps.rb:233:in `open'
C:/Program Files (x86)/Heroku/lib/heroku/command.rb:212:in `run'
C:/Program Files (x86)/Heroku/lib/heroku/cli.rb:33:in `start'
C:/Program Files (x86)/Heroku/bin/heroku:29:in `<main>'
Heroku client internal error.
undefined method `map' for #<String:0x33a0038>
C:/Program Files (x86)/Heroku/lib/heroku/helpers/heroku_postgresql.rb:144:in `app_attachments'
C:/Program Files (x86)/Heroku/lib/heroku/helpers/heroku_postgresql.rb:149:in `hpg_databases'
C:/Program Files (x86)/Heroku/lib/heroku/helpers/heroku_postgresql.rb:211:in `hpg_resolve'
C:/Program Files (x86)/Heroku/lib/heroku/helpers/heroku_postgresql.rb:103:in `resolve'
C:/Program Files (x86)/Heroku/lib/heroku/command/pg.rb:179:in `reset'
C:/Program Files (x86)/Heroku/lib/heroku/command.rb:212:in `run'
C:/Program Files (x86)/Heroku/lib/heroku/cli.rb:33:in `start'
C:/Program Files (x86)/Heroku/bin/heroku:29:in `<main>'
Heroku client internal error.
undefined method `map' for #<String:0x32ad578>
C:/Program Files (x86)/Heroku/lib/heroku/helpers/heroku_postgresql.rb:144:in `app_attachments'
C:/Program Files (x86)/Heroku/lib/heroku/helpers/heroku_postgresql.rb:149:in `hpg_databases'
C:/Program Files (x86)/Heroku/lib/heroku/helpers/heroku_postgresql.rb:211:in `hpg_resolve'
C:/Program Files (x86)/Heroku/lib/heroku/helpers/heroku_postgresql.rb:103:in `resolve'
C:/Program Files (x86)/Heroku/lib/heroku/command/pg.rb:179:in `reset'
C:/Program Files (x86)/Heroku/lib/heroku/command.rb:212:in `run'
C:/Program Files (x86)/Heroku/lib/heroku/cli.rb:33:in `start'
C:/Program Files (x86)/Heroku/bin/heroku:29:in `<main>'
Heroku client internal error.
undefined method `map' for #<String:0x3305670>
C:/Program Files (x86)/Heroku/lib/heroku/helpers/heroku_postgresql.rb:144:in `app_attachments'
C:/Program Files (x86)/Heroku/lib/heroku/helpers/heroku_postgresql.rb:149:in `hpg_databases'
C:/Program Files (x86)/Heroku/lib/heroku/helpers/heroku_postgresql.rb:211:in `hpg_resolve'
C:/Program Files (x86)/Heroku/lib/heroku/helpers/heroku_postgresql.rb:103:in `resolve'
C:/Program Files (x86)/Heroku/lib/heroku/command/pg.rb:179:in `reset'
C:/Program Files (x86)/Heroku/lib/heroku/command.rb:212:in `run'
C:/Program Files (x86)/Heroku/lib/heroku/cli.rb:33:in `start'
C:/Program Files (x86)/Heroku/bin/heroku:29:in `<main>'
Heroku client internal error.
undefined method `has_key?' for "plan":String
C:/Users/sokhan/.heroku/client/lib/heroku/command/addons.rb:134:in `create'
C:/Users/sokhan/.heroku/client/lib/heroku/command.rb:212:in `run'
C:/Users/sokhan/.heroku/client/lib/heroku/cli.rb:33:in `start'
C:/Program Files (x86)/Heroku/bin/heroku:29:in `<main>'
Heroku client internal error.
undefined method `map' for #<String:0x3467688>
C:/Program Files (x86)/Heroku/lib/heroku/helpers/heroku_postgresql.rb:144:in `app_attachments'
C:/Program Files (x86)/Heroku/lib/heroku/helpers/heroku_postgresql.rb:149:in `hpg_databases'
C:/Program Files (x86)/Heroku/lib/heroku/helpers/heroku_postgresql.rb:211:in `hpg_resolve'
C:/Program Files (x86)/Heroku/lib/heroku/helpers/heroku_postgresql.rb:103:in `resolve'
C:/Program Files (x86)/Heroku/lib/heroku/command/pg.rb:179:in `reset'
C:/Program Files (x86)/Heroku/lib/heroku/command.rb:212:in `run'
C:/Program Files (x86)/Heroku/lib/heroku/cli.rb:33:in `start'
C:/Program Files (x86)/Heroku/bin/heroku:29:in `<main>'
Heroku client internal error.
undefined method `map' for #<String:0x3493ad0>
C:/Program Files (x86)/Heroku/lib/heroku/helpers/heroku_postgresql.rb:144:in `app_attachments'
C:/Program Files (x86)/Heroku/lib/heroku/helpers/heroku_postgresql.rb:149:in `hpg_databases'
C:/Program Files (x86)/Heroku/lib/heroku/helpers/heroku_postgresql.rb:211:in `hpg_resolve'
C:/Program Files (x86)/Heroku/lib/heroku/helpers/heroku_postgresql.rb:103:in `resolve'
C:/Program Files (x86)/Heroku/lib/heroku/command/pg.rb:179:in `reset'
C:/Program Files (x86)/Heroku/lib/heroku/command.rb:212:in `run'
C:/Program Files (x86)/Heroku/lib/heroku/cli.rb:33:in `start'
C:/Program Files (x86)/Heroku/bin/heroku:29:in `<main>'
Heroku client internal error.
undefined method `map' for #<String:0x356b9e0>
C:/Program Files (x86)/Heroku/lib/heroku/helpers/heroku_postgresql.rb:144:in `app_attachments'
C:/Program Files (x86)/Heroku/lib/heroku/helpers/heroku_postgresql.rb:149:in `hpg_databases'
C:/Program Files (x86)/Heroku/lib/heroku/helpers/heroku_postgresql.rb:211:in `hpg_resolve'
C:/Program Files (x86)/Heroku/lib/heroku/helpers/heroku_postgresql.rb:103:in `resolve'
C:/Program Files (x86)/Heroku/lib/heroku/command/pg.rb:179:in `reset'
C:/Program Files (x86)/Heroku/lib/heroku/command.rb:212:in `run'
C:/Program Files (x86)/Heroku/lib/heroku/cli.rb:33:in `start'
C:/Program Files (x86)/Heroku/bin/heroku:29:in `<main>'
Heroku client internal error.
undefined method `map' for #<String:0x34e3798>
C:/Program Files (x86)/Heroku/lib/heroku/helpers/heroku_postgresql.rb:144:in `app_attachments'
C:/Program Files (x86)/Heroku/lib/heroku/helpers/heroku_postgresql.rb:149:in `hpg_databases'
C:/Program Files (x86)/Heroku/lib/heroku/helpers/heroku_postgresql.rb:211:in `hpg_resolve'
C:/Program Files (x86)/Heroku/lib/heroku/helpers/heroku_postgresql.rb:103:in `resolve'
C:/Program Files (x86)/Heroku/lib/heroku/command/pg.rb:179:in `reset'
C:/Program Files (x86)/Heroku/lib/heroku/command.rb:212:in `run'
C:/Program Files (x86)/Heroku/lib/heroku/cli.rb:33:in `start'
C:/Program Files (x86)/Heroku/bin/heroku:29:in `<main>'
Heroku client internal error.
undefined method `map' for #<String:0x35b37a0>
C:/Program Files (x86)/Heroku/lib/heroku/helpers/heroku_postgresql.rb:144:in `app_attachments'
C:/Program Files (x86)/Heroku/lib/heroku/helpers/heroku_postgresql.rb:149:in `hpg_databases'
C:/Program Files (x86)/Heroku/lib/heroku/helpers/heroku_postgresql.rb:211:in `hpg_resolve'
C:/Program Files (x86)/Heroku/lib/heroku/helpers/heroku_postgresql.rb:103:in `resolve'
C:/Program Files (x86)/Heroku/lib/heroku/command/pg.rb:179:in `reset'
C:/Program Files (x86)/Heroku/lib/heroku/command.rb:212:in `run'
C:/Program Files (x86)/Heroku/lib/heroku/cli.rb:33:in `start'
C:/Program Files (x86)/Heroku/bin/heroku:29:in `<main>'
Heroku client internal error.
undefined method `map' for #<String:0x3373818>
C:/Program Files (x86)/Heroku/lib/heroku/helpers/heroku_postgresql.rb:144:in `app_attachments'
C:/Program Files (x86)/Heroku/lib/heroku/helpers/heroku_postgresql.rb:149:in `hpg_databases'
C:/Program Files (x86)/Heroku/lib/heroku/helpers/heroku_postgresql.rb:211:in `hpg_resolve'
C:/Program Files (x86)/Heroku/lib/heroku/helpers/heroku_postgresql.rb:103:in `resolve'
C:/Program Files (x86)/Heroku/lib/heroku/command/pg.rb:179:in `reset'
C:/Program Files (x86)/Heroku/lib/heroku/command.rb:212:in `run'
C:/Program Files (x86)/Heroku/lib/heroku/cli.rb:33:in `start'
C:/Program Files (x86)/Heroku/bin/heroku:29:in `<main>'
Heroku client internal error.
undefined method `map' for #<String:0x34eb5f8>
C:/Program Files (x86)/Heroku/lib/heroku/helpers/heroku_postgresql.rb:144:in `app_attachments'
C:/Program Files (x86)/Heroku/lib/heroku/helpers/heroku_postgresql.rb:149:in `hpg_databases'
C:/Program Files (x86)/Heroku/lib/heroku/helpers/heroku_postgresql.rb:211:in `hpg_resolve'
C:/Program Files (x86)/Heroku/lib/heroku/helpers/heroku_postgresql.rb:103:in `resolve'
C:/Program Files (x86)/Heroku/lib/heroku/command/pg.rb:179:in `reset'
C:/Program Files (x86)/Heroku/lib/heroku/command.rb:212:in `run'
C:/Program Files (x86)/Heroku/lib/heroku/cli.rb:33:in `start'
C:/Program Files (x86)/Heroku/bin/heroku:29:in `<main>'
Heroku client internal error.
undefined method `map' for #<String:0x33af8f0>
C:/Program Files (x86)/Heroku/lib/heroku/helpers/heroku_postgresql.rb:144:in `app_attachments'
C:/Program Files (x86)/Heroku/lib/heroku/helpers/heroku_postgresql.rb:149:in `hpg_databases'
C:/Program Files (x86)/Heroku/lib/heroku/helpers/heroku_postgresql.rb:211:in `hpg_resolve'
C:/Program Files (x86)/Heroku/lib/heroku/helpers/heroku_postgresql.rb:103:in `resolve'
C:/Program Files (x86)/Heroku/lib/heroku/command/pg.rb:179:in `reset'
C:/Program Files (x86)/Heroku/lib/heroku/command.rb:212:in `run'
C:/Program Files (x86)/Heroku/lib/heroku/cli.rb:33:in `start'
C:/Program Files (x86)/Heroku/bin/heroku:29:in `<main>'
Heroku client internal error.
undefined method `map' for #<String:0x00000004170fd0>
C:/Program Files (x86)/Heroku/lib/heroku/helpers/heroku_postgresql.rb:144:in `app_attachments'
C:/Program Files (x86)/Heroku/lib/heroku/helpers/heroku_postgresql.rb:149:in `hpg_databases'
C:/Program Files (x86)/Heroku/lib/heroku/helpers/heroku_postgresql.rb:211:in `hpg_resolve'
C:/Program Files (x86)/Heroku/lib/heroku/helpers/heroku_postgresql.rb:103:in `resolve'
C:/Program Files (x86)/Heroku/lib/heroku/command/pg.rb:179:in `reset'
C:/Program Files (x86)/Heroku/lib/heroku/command.rb:212:in `run'
C:/Program Files (x86)/Heroku/lib/heroku/cli.rb:33:in `start'
C:/Program Files (x86)/Heroku/bin/heroku:29:in `<main>'
ransombriggs commented 8 years ago

@soniacaan What is your apps name? If you do not feel comfortable sharing it in this issue, feel free to email it to me at rbriggs@heroku.com .

soniacaan commented 8 years ago

On Heroku its: morning-journey-96221

Now I am trying to migrate the app on my local machine to vagrant VM. But this error is also stopping the ability to create a backup too and restore to local.

Thanks, S

ransombriggs commented 8 years ago

@soniacaan Sorry, but could you please try again? This error comes from a JSON response parsing failure. I did a request and checked the JSON for your app and it parses fine for me. I then recreated an app with the same setup as yours on my Windows machine to make sure it was not a windows thing and everything appeared to work. Could you try again, just in case it was a temporary issue with the API ?

One difference I noticed between your machine and mine is that my heroku install uses the one that ships with the toolbelt (2.1.7), while yours is using your ruby install (2.2.4). Could you paste the first couple of lines from C:/Program Files (x86)/Heroku/bin/heroku and the output of C:/Program Files (x86)/Heroku/ruby-2.1.7/bin/ruby -v ? This may also explain the differences we see in behavior.

soniacaan commented 8 years ago

I decided to setup Vagrant VM to try to cut out some of the windows related issues, but getting the same error, so it might be my heroku setup, is my guess.

type C:/Program Files (x86)/Heroku/bin/heroku
#!/bin/sh
# find embedded ruby relative to script
bindir=`cd -P "${0%/*}/../ruby-2.1.7/bin" 2>/dev/null; pwd`
exec "$bindir/ruby" -x "$0" "$@"

#!/usr/bin/env ruby
# encoding: UTF-8

# resolve bin path, ignoring symlinks
require "pathname"
bin_file = Pathname.new(__FILE__).realpath

# add locally vendored gems to libpath
gem_dir = File.expand_path("../../vendor/gems", bin_file)
Dir["#{gem_dir}/**/lib"].each do |libdir|
  $:.unshift libdir
end

# add self to libpath
$:.unshift File.expand_path("../../lib", bin_file)

# inject any code in ~/.heroku/client over top
require "heroku/updater"
Heroku::Updater.inject_libpath

# start up the CLI
require "heroku/cli"
Heroku.user_agent = "heroku/toolbelt/#{Heroku::VERSION} (#{RUBY_PLATFORM}) ruby/#{RUBY_VERSION}"
Heroku::CLI.start(*ARGV)
C:\Program Files (x86)\Heroku\ruby-2.1.7\bin>ruby -v
ruby 2.1.7p400 (2015-08-18 revision 51632) [i386-mingw32]
soniacaan commented 8 years ago

Did some digging. This is another error I came across, not sure if this is the root cause of sorts.

$heroku keys
===  Keys
 !    Heroku client internal error.
 !    Search for help at: https://help.heroku.com
 !    Or report a bug at: https://github.com/heroku/heroku/issues/new

    Error:       undefined method `map' for #<String:0x000000040fdbe8> (NoMethodError)
    Command:     heroku keys
    Version:     heroku/toolbelt/3.42.38 (x64-mingw32) ruby/2.2.4
    Error ID:    fa0bbf00027b44218ab4dd79ea75f43a
ransombriggs commented 8 years ago

@soniacaan Sorry for the delayed response, could you also attach the value of your %PATH% ?

ransombriggs commented 8 years ago

@soniacaan Could you please run heroku update and heroku version and verify you have heroku-toolbelt/3.42.39 and then try again? I just shipped some code so that the error output is more clear. This will not fix your problem, but will give us better insight into the cause.