Heroku Cedar-14 and libjpeg.so.62 - ruby-on-rails

After upgrading a production application on Heroku to cedar-14, I am running into issues with carrierwave-video-thumbnailer. In particular, I get the error:
ffmpegthumbnailer: error while loading shared libraries: libjpeg.so.62: cannot open shared object file: No such file or directory
After looking into this, I found that other people are having issues with libjpeg after upgrading to cedar-14 (for other gems besides ffmpegthumbnailer)
My questions are:
Is there a way to fix this?, or otherwise
How can I revert back to cedar-10?
(I tried heroku stack:set cedar-10 but get the error resource not found)

You only have a limited time left on cedar-10, so you'd do well to try to fix the issue. However, if you need to revert it temporarily, read on.
heroku stack:set cedar doesn't seem to be working anymore, probably because it is a ticking time bomb.
To rollback, you can use the heroku rollback functionality.
First, get the version number of the most recent release before you upgraded.
heroku releases
Then, do:
heroku rollback v65
(using the version you identified from the previous step instead of v65)
Good luck!

Related

Source files not updating in RubyMine after pulling from heroku

So, I did the "smart" thing of deleting the local branch where I had just fixed a bunch of stuff and now my only working copy of it is in my current heroku release. I tried using git pull and also tried using the process of creating a tracking branch to have a local copy of what is currently on heroku, but neither seems to have worked. When I bring up RubyMine and look at the source files they are the older versions before I updated them with my fixes. Can anyone suggest what I might be doing wrong? I've used heroku/git for a little while now but mainly to push updates to heroku. This is my first time trying to pull code down from it. I am tempted to try using heroku git:clone but worried that might be a fatal mistake if it stomps on my local stuff and then I have no complete working copy. Thanks for your help.

Heroku gem versioning issue

I've been working on an application that runs on Heroku for awhile and occasionally I run into a funny issue where my background workers start failing. It's as if the background workers have an old version of the gem, which used to talk to a HTTP API and was switched to hit a HTTPS endpoint. The gem that's causing problems is written by me and is pulled from Github with the following line in my Gemfile:
gem 'stubhub', github: 'Zanfa/stubhub'
From my logs, I can see that I'm getting 403s because it tries to hit the non-HTTPS url (which does not exist in the gem anywhere). However when I open the console with heroku run rails c and run the job from there, it never has the same issue.
I've also tried heroku run bundle list and bundle list to compare if there's a mismatch in versions, but it always reports the current version 0.0.23.
And to make things more interesting, this doesn't always happen. There's only like a 20% chance that it will start hitting the non-https endpoint, and doing heroku restart usually fixes it, but it will pop up again in a couple of pushes.
What you need to remember is that every time you do heroku run you're instantiating your slug into a new dyno, not interacting with your existing dynos. Googling will show different people dealing with Bundler caching issues, like http://artsy.github.io/blog/2013/01/15/debugging-bundler-issues-with-heroku/
My advice is to push a version of your repo with an empty Gemfile (to clear out the cache) and then push your normal repo again.

Rails Asset - NoMethodError `dependency_digest`

Seemingly out of nowhere a rails project has broken for me on my local machine. The same codebase is working on production though, interestingly enough.
As soon as any asset tries to load I get the following error:
undefined method `dependency_digest' for #<Sprockets::StaticAsset:0x007fefb93d0d28>
The error appears even as the site tries to load the stylesheet_link_tag, but it seems to be happening for all assets.
Inasmuch as I can tell, I've made no changes to incite this error. In fact, the local server was working (both with pow and webrick) and then, just stopped. After no changes.
I've tried reverting the history back through my commits, but with absolutely no luck.
Any ideas?
This should solve it.
rake tmp:cache:clear
On Heroku, I ran into this problem after switching around some buildpacks. The accepted answer on this SO post did NOT fix my problem (rake tmp:cache:clear) although it may have fixed other people's problems, the only way I could fix this was using:
heroku repo:purge_cache -a appname
see https://github.com/heroku/heroku-repo for documentation on the heroku repo plug-in

how to relaunch rails app on heroku

My app runs properly locally and has a crash when it runs on Heroku. The app does fine until I run a new_post_path call. I tried git push to see if a change to the new.html.erb file or the _form.html.erb file was the issue - but I think during the last push to heroku - my database may have taken a hit. At the time I was adding a t.text field (longtext) and it seems to be the issue.
So I wanted to roll back or totally re-start at heroku. But I have not found anyway to do it. Since this is not near production yet. Is there anyway to just create a new instance at heroku and push up to it?
Again, local version runs perfect. Thanks in advance for any ideas.
I would say there are several ways to handle this problem
restarting heroku
Run $ heroku restart in the rails dir. Sometimes I believe in magic.
debugging
Use $ heroku log to debug what is causing the error.
migrate database
Perhaps you made a database change in local rails, while heroku rails didn't.
Run heroku run rake db:migrate
drop database and remigrate database
See this thread. Sometimes old migration might be in conflict with current migration. Do a clean migration, if the data in your database isn't important.
recreate heroku instance
run $ heroku apps:destroy –app appname and replace appname with your appname. Then delete the current heroku remote repository location from git. git remote rm heroku. Then recreate heroku. run $ heroku create. go through pushing your code and migrating database like usual.
Relaunching might be the least of your problems, so I suggest a few things:
Review this Heroku article on releases, including the Heroku rollback feature.
Add the PG Backups add-on to your app.
I also recommend using something like the exception_notification gem in combination with the SendGrid add-on, so that you can get an email with details on the error as well.

Not able to push my code into AWS EB

I have been facing issue with pushing my ruby on rails code into AWS ElasticBeansTalk server. I first time was able to initialize the EB, commit and push the code and tried to run the EB server. Everything was fine, but after a few commits, suddenly it is raising the exception as following.
remote: error: Unable to create application version: You cannot have more than 500 Application Versions. Either remove some Application Versions or request a limit increase.
I am not able to find what to do with that. Can anybody help me out to achieve the solution clearly please?
Thanks in advance.
The error code suggests you've pushed a very large number of builds onto the Elastic Beanstalk environment. Try going in to your AWS Console, and go to Elastic Beanstalk, and from the Actions button for your application, select View Application Versions.
Most probably, you'll find 500 different versions of your application here. Select as many old ones as you wish, and do Delete to remove these. Then you should be able to continue.
(Of course, if my hunch is correct, a more interesting question is how on earth you've managed to upload 500 different versions of your application. I'm not running Ruby on Rails, so I'm not too familiar with that environment...)
Good luck!
Use eb labs cleanup-versions --num-to-leave=some_value to leave "some_value" number of last application versions and eb labs cleanup-versions --help to get a full list of available commands. Notice, that eb labs is experimental branch and its syntax may differ based on eb cli version.
After deleting the older application versions, git aws.push started to work again. It would be nice if the version limit error was returned by git aws.push as it would have saved a lot of time.
So follow below steps to resolve this isue.
logged in to console
Go to Elastic Beanstalk and select you application and environment
Find button "Upload and deploy" below text 'running version' and click it
To deploy a previous version, go to the "Application Versions page".
Select your last commit and delete this version label.
6 Again try to deploy with the new version.

Resources