heroku / heroku-fork Goto Github PK
View Code? Open in Web Editor NEWHeroku CLI plugin to fork an existing app into a new app
Home Page: https://www.npmjs.com/package/heroku-fork
License: ISC License
Heroku CLI plugin to fork an existing app into a new app
Home Page: https://www.npmjs.com/package/heroku-fork
License: ISC License
Hi,
I would very much appreciate if you could revert the decision to deprecate heroku fork
. I use it quite often to create test and staging apps. It would be very tedious and error prone to have to do this manually.
Using review apps as an alternative doesn't work for us since we don't use github.
So... please?
from #14
Should be able to avoid this :
$ heroku fork --from sourceapp --to targetapp
Forking sourceapp... done. Forked to targetapp
Setting buildpacks... done
Adding zerigo_dns:free to targetapp as ZERIGO_DNS... !
▸ Application error.
There was an error forking to targetapp.
In order to avoid being charged for any resources on targetapp, it is being destroyed...
Destroying app targetapp... done
Right now, if an addon can't be provisioned, the full command doesn't fail:
00:01:27.862 Deploying build/d to our-app-name... done
00:01:31.992 Adding addon newrelic:wayne to our-app-name... done
00:01:36.095 Adding addon librato:development to our-app-name... done
00:01:36.372 Adding addon scheduler:standard to our-app-name... done
00:02:01.689 Adding addon heroku-postgresql:standard-0 to our-app-name... Skipped addon heroku-postgresql:standard-0
00:02:01.690 ! Could not communicate with vendor, please try again later
00:02:01.690 Copying config vars:
00:02:01.889 DATABASE_URL
00:02:01.890 RACK_ENV
...
In that case, having Postgresql provisioned is essential to the successful deploy of the app, and it of course fails later on in the process with a message about the app not having any databases. I think that if an individual addon can't be provisioned, this should fail so that it can be dealt with accordingly.
I ran: heroku fork --copy-pg-data --app base-app-name target-app-name
Adding addon sendgrid:starter to target-app-name... done
Adding addon heroku-postgresql:standard-0 to target-app-name... done
Transferring HEROKU_POSTGRESQL_BROWN to HEROKU_POSTGRESQL_ORANGE...
SyntaxError: Unexpected token <
at Object.parse (native)
at Request.parseBody (/Users/taylorbrown/.heroku/node_modules/heroku-fork/node_modules/heroku-client/lib/request.js:230:17)
at Request.handleFailure (/Users/taylorbrown/.heroku/node_modules/heroku-fork/node_modules/heroku-client/lib/request.js:261:19)
at ConcatStream.directResponse [as cb] (/Users/taylorbrown/.heroku/node_modules/heroku-fork/node_modules/heroku-client/lib/request.js:167:12)
at ConcatStream.end (/Users/taylorbrown/.heroku/node_modules/heroku-fork/node_modules/heroku-client/node_modules/concat-stream/index.js:44:21)
at IncomingMessage.onend (_stream_readable.js:489:10)
at IncomingMessage.g (events.js:257:16)
at emitNone (events.js:72:20)
at IncomingMessage.emit (events.js:163:7)
at _stream_readable.js:891:16
I echoed the buffer to see what it was trying to convert into an object, and got this:
about to parse buffer <Buffer 3c 68 31 3e 4e 6f 74 20 46 6f 75 6e 64 3c 2f 68 31 3e>
I haven't translated this into ascii yet.
When you have a database that is a primary but under the certain circumstances, heroku fork
will create a new database within a new app, and do not make it as a primary database within the new app, which will end up copying the old app's DATABASE_URL
to the new app. Now your forked app will be pointing to the original app's database, which can cause a nightmare.
Here is roughly what happens:
DATABASE_URL
config var with a new app, we copy the old app's DATABASE_URL
to the new appThe reason of the old app's AMBER is not recognized as DATABASE_URL
is a long story but it can certainly happen. One workaround that I can think of is to promote such database after the creation manually so that the new app will have a proper DATABASE_URL
.
I don't think I'm explaining the issue well enough here, please ping me if you have nay questions. Also I'm happy to discuss about potential fixes.
We had one customer who used --skip-pg
flag and did manually create a forked database (since it's faster for lots of prod database), but since heroku fork
command copied DATABASE_URL
during the creation, creating a new database with forked app didn't have it promote as a primary database, so they were accidentally writing the things to the original application.
We should consider skipping copying DATABASE_URL
when --skip-pg
flag was passed to avoid the mess, or at lease we should super warn this
Other plugins seem to be installing fine. This one is throwing an npm error. It looks like its trying to fetch from a nonexistent source...
Any ideas how to remedy this? Is it a problem on my end? I have tried deleting my entire .heroku folder and reinstalling...
$ heroku plugins:install heroku-fork
Installing plugin heroku-fork... ▸ npm ERR! fetch failed http://heroku-plugins-npm.herokuapp.com/ini/-/ini-1.3.4.tgz
▸ npm WARN retry will retry, error on last attempt: Error: fetch failed with status code 404
▸ npm ERR! fetch failed http://heroku-plugins-npm.herokuapp.com/ini/-/ini-1.3.4.tgz
▸ npm WARN retry will retry, error on last attempt: Error: fetch failed with status code 404
▸ npm ERR! fetch failed http://heroku-plugins-npm.herokuapp.com/ini/-/ini-1.3.4.tgz
▸ npm ERR! Darwin 14.1.0
▸ npm ERR! argv "/Users/andrewpalmer/.heroku/iojs-v2.2.1-darwin-x64/bin/iojs" "/Users/andrewpalmer/.heroku/iojs-v2.2.1-darwin-x64/lib/node_modules/npm/cli.js" "install" "heroku-fork"
▸ npm ERR! node v2.2.1
▸ npm ERR! npm v2.11.0
▸
▸ npm ERR! fetch failed with status code 404
▸ npm ERR!
▸ npm ERR! If you need help, you may report this error at:
▸ npm ERR! https://github.com/npm/npm/issues
▸
▸ npm ERR! Please include the following file with any support request:
▸ npm ERR! /Users/andrewpalmer/.heroku/npm-debug.log
Just got this error when trying to fork an application. Hopefully it's transient, and if it is, I'll come back and close. Wanted to make you aware as soon as I got it though.
Thanks!
0:17:56.837 + heroku fork --app X Y
00:17:58.696 Installing plugin heroku-fork... npm ERR! Linux 3.13.0-43-generic
00:17:58.717 npm ERR! argv "/home/vagrant/.heroku/iojs-v2.0.0-linux-x64/bin/iojs" "/home/vagrant/.heroku/iojs-v2.0.0-linux-x64/lib/node_modules/npm/cli.js" "install" "heroku-fork"
00:17:58.719 npm ERR! node v2.0.0
00:17:58.720 npm ERR! npm v2.9.0
00:17:58.721 npm ERR! code ETARGET
00:17:58.721
00:17:58.722 npm ERR! notarget No compatible version found: heroku-cli-util@'>=1.9.0 <2.0.0'
00:17:58.722 npm ERR! notarget Valid install targets:
00:17:58.723 npm ERR! notarget ["1.0.0","1.0.1","1.1.0","1.2.0","1.3.0","1.4.0","1.5.0","1.7.0","1.8.0","1.8.1"]
00:17:58.724 npm ERR! notarget
00:17:58.724 npm ERR! notarget This is most likely not a problem with npm itself.
00:17:58.725 npm ERR! notarget In most cases you or one of your dependencies are requesting
00:17:58.726 npm ERR! notarget a package version that doesn't exist.
00:17:58.727 npm ERR! notarget
00:17:58.727 npm ERR! notarget It was specified as a dependency of 'heroku-fork'
00:17:58.728 npm ERR! notarget
00:17:58.728
00:17:58.738 npm ERR! Please include the following file with any support request:
00:17:58.739 npm ERR! /home/vagrant/.heroku/npm-debug.log
00:17:58.743 ERROR: exit status 1
00:17:59.070 Usage: heroku COMMAND [--app APP] [command-specific-options]
00:17:59.070
00:17:59.070 Help topics, type "heroku help TOPIC" for more details:
00:17:59.071
00:17:59.071 heroku version # print the version
00:17:59.071 heroku plugins # manage plugins
00:17:59.072 heroku update # update heroku-cli
CircleCI is deprecating V1 syntax: https://circleci.com/blog/sunsetting-1-0/
We should update to V2 to avoid running into issues at the deprecation date.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.