Blog - Unity Behind Diversity

Searching for beauty in the dissonance

Tagged: howto

HOWTO: Redmine 3.0 with Debian Wheezy, Nginx, Thin

I spent a few hours troubleshooting a problem with Thin when I upgraded from Redmine 2.5 to Redmine 3.0 on a Debian Wheezy server. I found a solution that’s worked for me. I’m not confident enough with Ruby and this setup to make a HowTo on the Redmine wiki, but I found next to nothing on this specific problem when searching the web, so I figure it’s important to post this in case it helps anyone else.

I’m running Redmine on Debian Wheezy with Nginx and Thin. I’m also running Redmine on another Wheezy server with Apache (and mod_passenger, I think). The latter upgrade to Redmine 3.0 went fine, but when I ran the same steps on the thin/nginx server, I was getting a Bad Gateway 502 error from nginx and found this in the thin logs.

!! Unexpected error while processing request: uninitialized constant Rack::MethodOverride::REQUEST_METHOD

Yet, when I ran Redmine with webrick (per Redmine’s installation instructions), it worked fine. Since it worked fine with webrick and on my other server, it seemed like the problem was at the Thin layer.

This Stack Overflow issue was the closest I could find, though it was with a different Rack application. The problem was a mismatch between the Rack version and the one required by the application.

I couldn’t find Redmine-specific examples (hence this post), but this one Redmine guide did say “Rack 1.0.1. Version 1.1 is not supported with Rails 2.3.5”.

Finally, the Stack Overflow issue linked to this issue in the Passenger tracker which pointed me towards the answer:

Your system has two Rack versions installed. One is version 1.5.0, installed by APT, and is located in /usr/lib/ruby/vendor_ruby. The other one is version 1.6.0, installed by RubyGems, and is located in /var/lib/gems/2.1.0/gems/rack-1.6.0.

Before Passenger loads your app, Passenger calls require “rack”. Because /usr/lib/ruby/vendor_ruby is in Ruby’s $LOAD_PATH, Passenger loads the Rack 1.5.0 library installed by APT.

However Sinatra requires Rack 1.6.0 or later…

This was my problem. When I installed Redmine 2.5, I ran `apt-get install thin`. It pulled in ruby-rack 1.4.1 as a dependency. This “conflict” wasn’t a problem in Redmine 2.5, which has “rack (~> 1.4.5)” in Gemfile.lock — the versions are close enough. However, Redmine 3.0 has “rack (~> 1.6)” in Gemfile.lock… hence the error I was seeing, as Rack 1.4.1 installed via apt was probably being loaded in place of the 1.6.1 Gem.

I tried to `apt-get remove ruby-rack`, but it was going to remove thin as well. (And I checked the Jessie repos, but its ruby-rack is still only 1.5.2.) I identified two solutions:

  1. Uninstall ruby-rack and thin via apt, and reinstall thin separately (this worked)
  2. Create a dummy .deb using equivs to install thin via apt without really installing ruby-rack (I didn’t bother trying this, since the first solution worked)

To install thin separately, first I removed it and ruby-rack whiling marking a couple other dependencies as manually installed and keeping the /etc/init.d/thin file…

apt-get remove ruby-rack thin
apt-get install ruby-eventmachine ruby-daemons # not sure if this was necessary or advisable, just a guess

Then, following the thin installation instructions, I was able to install the gem:
apt-get install ruby-dev build-essential
gem install thin
# Update the path in /etc/init.d/thin from /usr/bin/thin (apt) to /usr/local/bin/thin (gem)
perl -pi -w -e 's/\/usr\/bin\/thin/\/usr\/local\/bin\/thin/g' /etc/init.d/thin

I was able to start thin again (`service thin start`), but I was getting a new error for which I found the solution here: add thin to your Gemfile.

So, somewhat reluctantly, I opened up Gemfile in the Redmine root directory and in between a couple other gem lines I added the line:
gem "thin"

Then, I restarted thin, and Redmine was working again!

Things I don’t like about this solution or am unsure of:

  • Editing Redmine’s Gemfile sucks, because I’ll lose that change on every update and I’ll have to re-apply it. Since it’s a simple one-liner and updates are every few months, it works for me for now.
  • I don’t know yet whether those other apt thin dependencies are required or might cause other conflicts in the future… but since it’s working now, and I’m not familiar with Ruby, I don’t feel like spending more time to experiment and find out.
  • Maybe I should have looked at other options beside thin, like Puma or Passenger? But since I already had Thin working before, I just decided to see if I could salvage it rather than exploring alternatives. Maybe thin isn’t the best option in this circumstance though, but it’s working.
  • I’m assuming that /etc/init.d/thin was there and working because it was leftover from the apt thin installation (and because I didn’t `apt-get purge`). That may have been lucky that the init script happens to work (as far as I can tell for now) with the thin gem…

Hopefully this can help anyone else using Redmine(3.0)/Debian/Nginx/Thin seeing that error. I’d be happy to share configuration and fresh installation instructions once I have some confidence that this approach is sane, and in particular once I have a better solution than modifying the Gemfile.

I spent a few hours troubleshooting a problem with Thin when I upgraded from Redmine 2.5 to Redmine 3.0 on a Debian Wheezy server. I found a solution that’s worked…

Creative Commons Attribution-ShareAlike 4.0 International Permalink | Comments (1)

SOLUTION: gPodder 2.20.3 on N900: database disk image malformed

After some strange behaviour in gPodder 2.20.3 yesterday on my N900 (not responding to episode actions), I quit gPodder and tried to start it up again, but it would crash during startup everytime with an error about “database disk image malformed” from line 316 of dbsqlite.py on the query: “SELECT COUNT(*), state, played FROM episodes GROUP BY state, played”.

First, I opened up the sqlite database directly:
sqlite3 ~/.config/gpodder/database.sqlite

I could run that query and others no problem.

However, I found this guide on repairing a corrupt sqlite database, I ran the following integrity check command and it returned a couple errors along with the “database disk image malformed” message:
sqlite> pragma integrity_check;

So I followed the instructions from spiceworks, dumped my database to file and reloaded it into a new database:
cd ~/.config/gpodder/
echo .dump | sqlite3 database.sqlite > gpodder.sql # generate dump file
mv database.sqlite database.sqlite.bak # backup original database
sqlite3 -init gpodder.sql database.sqlite # initialize a new database from the dump file

And, voila, gPodder is working again.

Creative Commons Attribution-ShareAlike 4.0 International Permalink | Post a Comment

Watch Movie Online Fifty Shades Darker (2017) subtitle english

Poster Movie Fifty Shades Darker 2017

Fifty Shades Darker (2017) HD

Director : James Foley.
Producer : Dana Brunetti, Michael De Luca, E.L. James, Marcus Viscidi.
Release : February 8, 2017
Country : United States of America.
Production Company : Universal Pictures.
Language : English.
Runtime : 118 min.
Genre : Drama, Romance.

‘Fifty Shades Darker’ is a movie genre Drama, was released in February 8, 2017. James Foley was directed this movie and starring by Dakota Johnson. This movie tell story about When a wounded Christian Grey tries to entice a cautious Ana Steele back into his life, she demands a new arrangement before she will give him another chance. As the two begin to build trust and find stability, shadowy figures from Christian’s past start to circle the couple, determined to destroy their hopes for a future together.

Do not miss to Watch movie Fifty Shades Darker (2017) Online for free with your family. only 2 step you can Watch or download this movie with high quality video. Come and join us! because very much movie can you watch free streaming.

Watch movie online Fifty Shades Darker (2017)

Incoming search term :

Fifty Shades Darker 2017 HD English Full Episodes Download
Fifty Shades Darker film trailer
Watch Fifty Shades Darker 2017 Online Free putlocker
live streaming movie Fifty Shades Darker 2017
Fifty Shades Darker 2017 Full Episodes Watch Online
Watch Fifty Shades Darker 2017 Online Putlocker
live streaming film Fifty Shades Darker 2017
Fifty Shades Darker 2017 For Free Online
Fifty Shades Darker 2017 Full Episode
streaming Fifty Shades Darker 2017 movie
Fifty Shades Darker 2017 Watch Online
Fifty Shades Darker 2017 Episodes Watch Online
watch full movie Fifty Shades Darker
streaming film Fifty Shades Darker
download full movie Fifty Shades Darker 2017
Watch Fifty Shades Darker 2017 Online Megashare
Watch Fifty Shades Darker 2017 Online Free
Fifty Shades Darker 2017 English Episode
Fifty Shades Darker 2017 Episodes Online
Fifty Shades Darker 2017 English Episodes Free Watch Online
movie Fifty Shades Darker streaming
trailer film Fifty Shades Darker 2017
watch full film Fifty Shades Darker 2017
Watch Fifty Shades Darker 2017 Online Free Viooz
Fifty Shades Darker 2017 English Full Episodes Free Download
Fifty Shades Darker 2017 English Full Episodes Online Free Download
download movie Fifty Shades Darker now
Fifty Shades Darker 2017 Online Free Megashare
Fifty Shades Darker 2017 For Free online
Fifty Shades Darker 2017 English Full Episodes Watch Online
Fifty Shades Darker 2017 Full Episodes Online
Fifty Shades Darker 2017 English Episodes
watch Fifty Shades Darker film now
Watch Fifty Shades Darker 2017 Online Free megashare
Fifty Shades Darker 2017 English Full Episodes Download
Watch Fifty Shades Darker 2017 Online Free Putlocker
Fifty Shades Darker 2017 HD Full Episodes Online
download movie Fifty Shades Darker 2017
download film Fifty Shades Darker now
watch movie Fifty Shades Darker 2017 now
Watch Fifty Shades Darker 2017 Online Viooz

Creative Commons Attribution-ShareAlike 4.0 International Permalink | Comments (5)

SOLUTION: Firefox Fails When Upgrading After Using Mozilla PPA

This is a quick fix for a problem I had when upgrading to Ubuntu 10.04, after having used the Mozilla PPA.

The Firefox upgrade failed during the distribution upgrade process (from 9.10 to 10.04). I was told to run `dpkg -a –configure`, and the same error occurred again (it’s in bold).

$ sudo dpkg -a --configure
Setting up firefox (3.6.3+nobinonly-0ubuntu4) ...
update-alternatives: error: alternative path /usr/bin/firefox doesn't exist.
dpkg: error processing firefox (--configure):
subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of firefox-3.5:
firefox-3.5 depends on firefox; however:
Package firefox is not configured yet.
dpkg: error processing firefox-3.5 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of firefox-3.0:
firefox-3.0 depends on firefox; however:
Package firefox is not configured yet.
dpkg: error processing firefox-3.0 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of firefox-gnome-support:
firefox-gnome-support depends on firefox (= 3.6.3+nobinonly-0ubuntu4); however:
Package firefox is not configured yet.
dpkg: error processing firefox-gnome-support (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of firefox-3.5-gnome-support:
firefox-3.5-gnome-support depends on firefox-gnome-support; however:
Package firefox-gnome-support is not configured yet.
dpkg: error processing firefox-3.5-gnome-support (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
firefox
firefox-3.5
firefox-3.0
firefox-gnome-support
firefox-3.5-gnome-support

A quick web search brought up a bug report, and I was able to figure out this fix with the help of one of the comments:

Update: Fixed.My original solution was only temporary, and had to be repeated for each Firefox update (all the way through every update with 10.04, 10.10, now 11.04…). I’ve found the root of the problem now, by comparing local dpkg diversions for Firefox on my affected machines against an unaffected clean Ubuntu install.

On my laptop:

$ sudo dpkg-divert --list | grep firefox
local diversion of /usr/bin/firefox to /usr/bin/firefox.ubuntu
local diversion of /usr/bin/mozilla-firefox to /usr/bin/mozilla-firefox.ubuntu

The clean Ubuntu install returned no results for the above command. (Also, note that in the full output for dpkg-divert –list, those were the only local diversion — another hint that they were from the PPA upgrade rather than Ubuntu itself.)

So, I ran the following commands to remove the diversions:
$ sudo dpkg-divert --remove /usr/bin/mozilla-firefox
$ sudo dpkg-divert --remove /usr/bin/firefox

Then, the most recent Firefox upgrades worked without a hitch on both of my affected machines. Finally fixed… *fingers crossed*

Updated: This isn’t a complete fix, as the problem reoccurs every time Firefox is updated. If someone knows how to fix this for good, let me know…

$ sudo rm /usr/bin/firefox
$ cd /usr/bin
$ sudo ln -s ../lib/firefox-<your-current-version>/firefox.sh firefox
$ sudo chmod 0777 firefox
$ sudo apt-get -f install

The symlink for /usr/bin/firefox had been pointing to /usr/bin/firefox-3.5, which no longer existed, so the commands above (1) remove the dead-end link; (2) add the proper link (YMMV depending on which version of Firefox you are upgrading to); (3) resume the upgrade process.

Hope that helps!

This is a quick fix for a problem I had when upgrading to Ubuntu 10.04, after having used the Mozilla PPA. The Firefox upgrade failed during the distribution upgrade process…

Creative Commons Attribution-ShareAlike 4.0 International Permalink | Comments (1)

SOLUTION: Extract .exe archive with 7z in Ubunu 9.04, fix “Unsupported Method” error

Just posting a quick fix to a problem I had with using 7z to extract an archive. I could list the contents of the archive, but any attempts to extract gave an “Unsupported Method” error. Dan Jacobson posted a solution to the debian bug tracking system, which is to install the package p7zip-rar.

In Ubuntu 9.04, I ran:
sudo apt-get install p7zip-rar

Now, I can extract the contents of my file with 7z as follows:
7z e TekSavvyAM.exe

Just posting a quick fix to a problem I had with using 7z to extract an archive. I could list the contents of the archive, but any attempts to extract…

Creative Commons Attribution-ShareAlike 4.0 International Permalink | Comments (10)