heroku / heroku-repo

Plugin for heroku CLI that can manipulate the repo
MIT License
689 stars 114 forks source link

"The requested API endpoint was not found." #86

Closed tengiao closed 6 years ago

tengiao commented 6 years ago

Hi folks!

I have deployed a Heroku app: https://ernestbikeberlin.herokuapp.com/

In my development environment, I created a Product class for my database, and I could access it without a problem via http://localhost:3000/products.

After deployment and having done a migration on Heroku, upon trying to open https://ernestbikeberlin.herokuapp.com/products, I was given a message saying:

We're sorry, but something went wrong. If you are the application owner check the logs for more information.

I ran heroku logs and found this:

FATAL -- : [2da12c81-7b1e-449b-9753-b05970f40119] ActionView::Template::Error (The asset "blahblahbmx.com" is not present in the asset pipeline.):

blahblahbmx.com had been used as a dummy URL during development and has since been replaced by a legitimate URL.

As this still shows up in the Heroku production environment, I suspect it is an issue of Rails asset caching not cleaning old assets properly. Hence, I downloaded heroku-repo hoping to purge my cache on the Heroku app as such:

heroku repo:purge_cache -a https://ernestbikeberlin.herokuapp.com/

I also tried:

heroku repo:purge_cache -a http://ernestbikeberlin.herokuapp.com/

But what I got was:

The requested API endpoint was not found. Are you using the right HTTP verb (i.e. GET vs. POST), and did you specify your intended version with the Accept header?

Would be nice if someone could give a few pointers to solving this.

Cheers! :)

Ernest

edmorley commented 6 years ago

Hi :-)

The -a parameter needs to be the Heroku app name rather than the app's URL. ie: heroku repo:purge_cache -a ernestbikeberlin

However the error message in this case could definitely make that clearer :-)

tengiao commented 6 years ago

Thanks @edmorley!

Having done cache purging now with the correct parameter, the issue still persists. According to the direction to run purge_cache, it is (or needs to be?):

done inside a run process on the application.

I have Heroku Toolbelt installed and been running heroku commands from my Bash shell, and that's where I ran purge_cache as well.

Not sure what "inside a run process" means.

Appreciate it if anyone could enlighten me ;)

Cheers, Ernest

edmorley commented 6 years ago

I believe it means the command is run inside a Heroku one-off dyno: https://devcenter.heroku.com/articles/one-off-dynos

ie: the way you are running the command is just fine.

If clearing the cache using that command didn't help I would try:

Good luck!

tengiao commented 6 years ago

Thanks again @edmorley! You have been of great help!

Unfortunately none of the above options worked, so I'm looking to filing a support ticket :)

Cheers, Ernest

dmathieu commented 6 years ago

This is definitely not an issue with this CLI plugin, so I'm closing this issue. Please open a support ticket, we can help you much more easily there.