app-json / app.json

A node module for working with app.json files and deploying app.json apps to Heroku. Designed to work on the server, the browser, and the command line.
132 stars 26 forks source link

app.json validate requires heroku toolbelt #15

Open hunterloftis opened 10 years ago

hunterloftis commented 10 years ago

Got reports of mysterious errors that stopped happening when users installed the heroku toolbelt.

We want to make sure this is heroku-newbie-friendly so it'd be a good idea to either check and fail in a friendly way, or pull in the toolbelt as a dependency.

(I haven't replicated this issue, will soon)

zeke commented 10 years ago

Yep, sounds believable. I suspect it's the clone command which, when invoked from the CLI, expects to find Heroku credentials in ~/.netrc

zeke commented 10 years ago

Wait you said validate. Hmmm.

hunterloftis commented 10 years ago

Yep that's the error

zeke commented 10 years ago

@hunterloftis are you sure it was the validate command? I don't think there's any code in that command that requires anything related to the toolbelt.

snodgrass23 commented 10 years ago

The validate command failed until I authed with the heroku gem.

hunterloftis commented 10 years ago

@zeke I can run some tests, put in some PRs. I want to get involved with this awesome project anyway!

zeke commented 10 years ago

@snodgrass23 do you by any chance still have the failure output?

snodgrass23 commented 10 years ago

I'm playing with the button on my repo here: https://github.com/snodgrass23/base12

I got an error when using the button, so I decided to validate the app.json file locally.

This is the error I get with the button: image

This is the error I got when trying to validate the ap.json file locally. image

snodgrass23 commented 10 years ago

The other trouble I had, and may have something to do with the error, is that I didn't know the official app.json parameters for the addons. I just kind of guessed.

https://github.com/snodgrass23/base12/blob/master/app.json#L5

zeke commented 10 years ago

@snodgrass23 thanks for the error screen. I stand corrected.

And your addons property looks right. Here's the schema documentation for future reference: https://devcenter.heroku.com/articles/app-json-schema#addons

zeke commented 10 years ago

:zap: nice prompt, btw

gonzalo-bulnes commented 9 years ago

Hi,

I can confirm this issue. I've been using this Rake task to validate (and only validate) my app.json files. Everything works as expected locally (I do have the Heroku toolbelt installed) but fails on Travis CI (the error is visible here).

I can also say that setting the HEROKU_API_KEY environment variable allows to work around the issue:

# in my case on Travis CI:
HEROKU_API_KEY=workaround rake app_json:validate

# more generally:
HEROKU_API_KEY=workaround app.json validate

It remains that having to provide an API key to perform validations was really not something I would have expected : /, @zeke maybe the token presence checking could be deferred until the token is actually required to be present?