Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read property 'pop' of undefined #361

Closed
jeffbr13 opened this issue Dec 15, 2016 · 6 comments
Closed

Cannot read property 'pop' of undefined #361

jeffbr13 opened this issue Dec 15, 2016 · 6 comments

Comments

@jeffbr13
Copy link

jeffbr13 commented Dec 15, 2016

Running heroku pg:copy DATABASE_URL HEROKU_POSTGRESQL_…_URL to upgrade a database results in the following error after initiating the copy (which seemed to start successfully):

 ▸    Cannot read property 'pop' of undefined
TypeError: Cannot read property 'pop' of undefined
    at /Users/ben/.local/share/heroku/cli/lib/node_modules/heroku-pg/lib/pgbackups.js:99:32
    at next (native)
    at onFulfilled (/Users/ben/.local/share/heroku/cli/lib/node_modules/co/index.js:65:19)
    at process._tickCallback (internal/process/next_tick.js:103:7)

Running with HEROKU_DEBUG=1 I get the following output (responses and private fields truncated):

Executing /Users/ben/.local/share/heroku/cli/bin/heroku
heroku-cli/5.6.3-e9e90d8 (darwin-amd64) go1.7.4 /Users/ben/.local/share/heroku/cli/bin/heroku cmd: pg:copy
--> POST /actions/addon-attachments/resolve
--> {"app":"stash-archive","addon_attachment":"DATABASE_URL"}
--> POST /actions/addon-attachments/resolve
--> {"app":"stash-archive","addon_attachment":"HEROKU_POSTGRESQL_COBALT_URL"}
<-- 200 OK
<-- […]
--> GET /addons/postgresql-closed-77622
--> GET /apps/stash-archive/config-vars
<-- 200 OK
<-- […]
--> GET /addons/postgresql-graceful-54431
--> GET /apps/stash-archive/config-vars
<-- 200 OK
<-- {…}
<-- 200 OK
<-- {…}
<-- 200 OK
<-- {…}
<-- 200 OK
<-- {…}
 ▸    WARNING: Destructive action
 ▸    This command will remove all data from COBALT
 ▸    Data from DATABASE will then be transferred to COBALT
 ▸    To proceed, type stash-archive or re-run this command with --confirm stash-archive

> stash-archive
--> POST /client/v11/databases/postgresql-graceful-54431/transfers
--> {…}
Starting copy of DATABASE to COBALT... ⣷
<-- 201 Created
<-- {"uuid":"…","num":9,"from_name":"DATABASE","from_type":"pg_dump","from_url":"…","to_name":"COBALT","to_type":"pg_restore","to_url":"…","options":{},"source_bytes":null,"processed_bytes":0,"succeeded":null,"warnings":0,"created_at":"2016-12-15 21:38:36 +0000","started_at":null,"canceled_at":nStarting copy of DATABASE to COBALT... done
--> GET /client/v11/apps/stash-archive/transfers/b1de4781-46b0-4e91-91e7-20d20b268103
Copying... ⣽
<-- 200 OK
<-- {"uuid":"…","num":9,"from_name":"DATABASE","from_type":"pg_dump","from_url":"…","to_name":"COBALT","to_type":"pg_restore","to_url":"…","options":{},"source_bytes":null,"processed_bytes":0,"succeeded":null,"warnings":0,"created_at":"2016-12-15 21:38:36 +0000","started_at":"2016-12-15 21:38:36Copying... !
 ▸    Cannot read property 'pop' of undefined
TypeError: Cannot read property 'pop' of undefined
    at /Users/ben/.local/share/heroku/cli/lib/node_modules/heroku-pg/lib/pgbackups.js:99:32
    at next (native)
    at onFulfilled (/Users/ben/.local/share/heroku/cli/lib/node_modules/co/index.js:65:19)
    at process._tickCallback (internal/process/next_tick.js:103:7)

I've tried re-installing and runningheroku update, even with deleting ~/.heroku and re-authenticating but this issue doesn't seem to go away.

@ransombriggs
Copy link

@jeffbr13 (on phone) I shipped an update to the CLI to fix this, could you 'heroku update' and try again? (The backup from before was scheduled, the bug was in the polling for status updates)

@jeffbr13
Copy link
Author

Excellent, works now, thank you!

@n1cklee
Copy link

n1cklee commented Jan 16, 2017

I am having the same issue.

nick@Nicks-MacBook-Pro-[12:06]$ heroku pg:copy DATABASE_URL postgresql-perpendicular-41934 --remote production
 ▸    WARNING: Destructive action
 ▸    This command will remove all data from CRIMSON
 ▸    Data from DATABASE will then be transferred to CRIMSON
 ▸    To proceed, type rocky-anchorage-35749 or re-run this command with --confirm rocky-anchorage-35749

> rocky-anchorage-35749
Starting copy of DATABASE to CRIMSON... done
Copying... !
 ▸    Cannot read property 'slice' of undefined

I tried running heroku update.

@ransombriggs

@corrspt
Copy link

corrspt commented Jan 24, 2017

@ransombriggs

Yup, having the same issue, but when using the
heroku pg:backups:restore 'http://path/to/export/db.dump' DATABASE_URL -a myapp

Restoring... ! ▸ Cannot read property 'slice' of undefined

What's more, it started to run and then halted... the database appears to have been wiped. Must figure out a way to restore the backup.

EDIT: I was hosting the file with the database dump on my website, I switched to using amazon s3 and it worked... no error, weird....

@ransombriggs
Copy link

@corrspt I pushed a release so if you run heroku update to get version 5.6.13 you should not see this error again. I saw your edit, so I am assuming that things are working properly for you now?

@n1cklee I am sorry I missed your comment, could you run heroku update and try again? There was an error running the copy command and now you should be able to see what was causing the error.

This was related to the pop issue, I was trying to fix that quickly and missed this usage, sorry for the inconvenience.

@corrspt
Copy link

corrspt commented Jan 24, 2017

@ransombriggs Yes, things are working properly :) In any case, thank you very much for such a quick response (with a release as well).

I don't quite understand what made the problem occur on a url and not on the other (I did went through your commit on heroku:pg but didn't understand) :)

Anyway, thanks again. No need to apologize, software development is hard :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants