{"id":185,"date":"2012-01-05T17:14:50","date_gmt":"2012-01-05T06:14:50","guid":{"rendered":"http:\/\/sijnstra.name\/blog\/?p=185"},"modified":"2012-01-05T17:14:50","modified_gmt":"2012-01-05T06:14:50","slug":"latest-diaspora-update-was-a-lot-of-work","status":"publish","type":"post","link":"http:\/\/sijnstra.name\/blog\/2012\/01\/05\/latest-diaspora-update-was-a-lot-of-work\/","title":{"rendered":"Latest Diaspora* update was a lot of work"},"content":{"rendered":"<p>So I&#8217;ve had some issues with Diaspora*, but the main one is <a href=\"http:\/\/www.diasporaforum.org\/forum\/showthread.php?300-inter-pod-communication-problems\">inter-pod communication<\/a> which doesn&#8217;t seem to work back to the main joindiaspora.com pod (and some others). I had neglected updating for a little while and thought I should get to it, and see if this issue was resolved.<\/p>\n<p>**Caution &#8211; the rest of this discussion is fairly technical **<\/p>\n<p>I had some trouble with the oath2 ruby gem for some time now as well, and during the update process I kept receiving errors about the .gemspec file format. I went through the usual update process to see if there would be an update to oath2 amongst others. So I used my usual 3 update commands:<br \/>\n<code><br \/>\ngit pull origin master<br \/>\nDB=\"mysql\" bundle install --without development,test<br \/>\nRAILS_ENV=\"production\" DB=\"mysql\" bundle exec rake db:migrate<br \/>\n<\/code><br \/>\nto find that it was more upset than usual about the update. The last command didn&#8217;t want to run at all, and there were far too many errors to see what was going on.<\/p>\n<p>The easiest solution to this I thought would be to clean up the Ruby gems by updating everything and seeing what happened. To do a more thorough udpate of the gems, I ran<br \/>\n<code><br \/>\nbundle update<br \/>\n<\/code><br \/>\nwhich resulted in:<\/p>\n<pre>\nWARNING:  Invalid .gemspec format in '\/usr\/lib\/ruby\/gems\/1.8\/specifications\/oaut\nh2-provider-0.0.19.gemspec'\nGems included by the bundle:\nCould not find oauth2-provider-0.0.19 in any of the sources\n<\/pre>\n<p>So I tried<br \/>\n<code><br \/>\ngem update<br \/>\n<\/code><br \/>\nand that&#8217;s when it all got interesting. Apparently I had run out of disk quote. Disk quota? As root? I check quota, sure enough, no quota applied. I ran a df to find I was using only 23% of disk space. So I tracked it down in the end &#8211; out of inodes.<\/p>\n<p>The magic command<br \/>\n<code><br \/>\ndf -i<br \/>\n<\/code><br \/>\nindicated that I&#8217;d used 100% of <a href=\"http:\/\/en.wikipedia.org\/wiki\/Inode\">inodes<\/a>. So then my search to find out where I could get more inodes from began.<\/p>\n<p>It turns out you can clean up some old files from git by issuing a command to do a garbage collection:<br \/>\n<code><br \/>\ngit gc<br \/>\n<\/code><br \/>\nof course, you can&#8217;t do this without having *some* spare inodes. So I cleaned up some otherwise unused files from a few places. Running this command gave me 25 spare inodes. Hmmm&#8230; still looking&#8230;.  Then it turned out that you need to ask gem to do some housekeeping. Gem keeps all the previous versions of RubyGems, and isn&#8217;t shy of using a lot of files. The magic words for gem are:<br \/>\n<code><br \/>\ngem cleanup<br \/>\n<\/code><br \/>\nwhich gave me over 20,000 free inodes after much work, ignoring a lot of errors and saying no to any extra removals that it questioned. Much better! Then I could complete the gem update I tried earlier. Sadly, there were still a lot of errors and it made it difficult to see what was going on, so I went about how to fix the invalid .gemspec format error. Fixing this required an update to gem itself, which can be run with<br \/>\n<code><br \/>\ngem update --system<br \/>\n<\/code><br \/>\nanother command which may be useful is<br \/>\n<code><br \/>\ngem install rubygems-update<br \/>\n<\/code><br \/>\nrunning this solved the .gemspec format error, but now 4 of the gems complained about an invalid datestamp format inside the .gemspec. This also needed fixing, which can be done by executing<br \/>\n<code><br \/>\ngem pristine<br \/>\n<\/code><br \/>\nand then updating back to current versions, followed again by cleaning up the unwanted files. You can do all of them at once, e.g. &#8216;gem pristine oath2 faraday mini_magick uuid&#8217; although I should mention that one didn&#8217;t work the first time for me so I had to do that step again. Then you can run &#8216;gem update&#8217; followed by &#8216;gem cleanup&#8217; and hey presto &#8211; totally clean install of gems!<\/p>\n<p>Now it was back in business with running the system properly. I ran the db:migrate successfully this time, and when I ran the server it couldn&#8217;t connect to redis. Apparently I had killed the process and shouldn&#8217;t have. Easily fixed with the old:<br \/>\n<code><br \/>\nnohup redis-server &amp;<br \/>\n<\/code><\/p>\n<p>So now diaspora* is running on my server again! Sadly, I still can&#8217;t communicate with other pods, but at least I got back in to the swing of system admin again.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So I&#8217;ve had some issues with Diaspora*, but the main one is inter-pod communication which doesn&#8217;t seem to work back to the main joindiaspora.com pod (and some others). I had neglected updating for a little while and thought I should get to it, and see if this issue was resolved. **Caution &#8211; the rest of &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/sijnstra.name\/blog\/2012\/01\/05\/latest-diaspora-update-was-a-lot-of-work\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Latest Diaspora* update was a lot of work&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2,5],"tags":[13,16,26,30],"_links":{"self":[{"href":"http:\/\/sijnstra.name\/blog\/wp-json\/wp\/v2\/posts\/185"}],"collection":[{"href":"http:\/\/sijnstra.name\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/sijnstra.name\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/sijnstra.name\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/sijnstra.name\/blog\/wp-json\/wp\/v2\/comments?post=185"}],"version-history":[{"count":0,"href":"http:\/\/sijnstra.name\/blog\/wp-json\/wp\/v2\/posts\/185\/revisions"}],"wp:attachment":[{"href":"http:\/\/sijnstra.name\/blog\/wp-json\/wp\/v2\/media?parent=185"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/sijnstra.name\/blog\/wp-json\/wp\/v2\/categories?post=185"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/sijnstra.name\/blog\/wp-json\/wp\/v2\/tags?post=185"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}