Heroku Error H14 with Django

H14 Error on Heorku

Today morning I did a new push to www.bikenomads.co.in with images from the fantastic 2013 calendar.

And the website died :(

One minute it was working fine, and the next it died ! Showing a problem with the app, and if you are the administrator to check the logs.

It took me 2 hrs to fix this, as Heroku site is not clear on what to do in case of errors ( see here for list of errors in Heroku) . So, here's a short guide to fix it ( this guide is for a Django project but I think it should work out similarly for other platforms )

First , if the app is not loading , check the logs in heroku. So, I logged into the web console and could not find the error log at all ! Apparently you need to use the command line for the logs as :

$ heroku logs
and it showed something like this to me : 
2013-02-16T08:35:49+00:00 heroku[web.1]: Process exited with status 143
2013-02-16T08:35:51+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path=/ host=www.bikenomads.co.in fwd="" dyno= queue= wait= connect= service= status=503 bytes=

The what ?! Web process exited ?? Then how will the site run ? I checked the web console and it did not show anything under "Dynos" ( I am also not sure if it existed 2 months back?) 

Check with heroku ps if there is any process running: 
$ heroku ps
That did not return anything. 

So, a bit of search over the net and stackexchange pointed to something called the Procfile - which I had never used before. Apparently, heroku picks up the info on what to run automatically, but sometimes it jinxes. It is safer to put the information into a Procfile . This problem seems to keep recurring for over a year, but Heroku guys have not fixed it or fixed their tutorials, and that is where it all starts going downhill. 

Now follow the steps below to fix it for your installation : 
1. Create a file called Procfile ( it is case sensitive - so capitalize P !) in the root directory of your application ( where you have the venv folder ) . On windows you will have to make sure that windows does not add a .txt extension . I use linux so it was just 'touch Procfile'.
2. Edit the file and put in the following details for Django ( other apps you will need to figure out depending on what is needed to run it ) :
web: python website/manage.py runserver$PORT
Note the spacing and the IP you need to give. If you miss out the last part, it will run on localhost which you will not be able to connect to from your machine. 
3. git add the file and do a git push heroku master to push this file to the server. We are not done yet even though the push says everything is fine.
4. Remember the heroku ps did not give any results earlier ? So, now you need to attach the process. Do this with the following command to add a web dyno :
$ heroku ps:scale web=1
Scaling web processes... done, now running 1
Check your website now and it should be working ! 

And check out my site : http://www.bikenomads.co.in 

Product Spec of a A Basic Phone

I was recently looking for a basic phone for my uncle ( and also for myself ) which would be cheap and have a long lasting battery life. I am yet to find something which suits me, but it got me thinking that there is no really good low end phone OS now.

What has happened in the last few years is that with the advent of the touchscreen, everyone wants to sell a touchscreen phone. Now, it makes sense when you have something which consumes a lot of data - e.g. for emails or browsing or facebook. And the low end phones - like the nokia Asha series - which are cheap to sell, have this touch tacked onto the phones. This is a pretty bad experience as things like scrolling etc do not work well.

The closest phone that I came to liking was the Motofone, but like Motorola is apt to do, they under-made the phone, and it did not do that well.

Motofone F3 - not quite there.

So, here is my specifications of a low end phone.

  • It will be a phone without internet access
    • There are many people who do not want internet access. They buy the phones and never enable 3G on the SIMs or if they do, they hardly use it. 
    • There are many places in the world where you do not have internet access. E.g. travelling in many parts of India. 
  • It will need to have a great battery life
    • I envisage that it should have a week's battery life. One of the most irritating things about phones nowdays it that you need to charge them atleast twice a day. 
    • Great battery life also means that if you leave the phone charger on a short trip, you do not worry. 
  • It will have a fast and responsive addressbook which syncs through your PC
    • After all, once you remove internet access, all that remains on the phone is the actual phone. 
    • Syncing with the PC means that your address book can be updated to google or whatever service. This will be through an installed program. 
      • Essentially this will be quite simple as the extract from the phone will be a simple vCard export which can be imported to various services. 
  • It will have a good camera
    • 5MP or so. Saves to a SD card so that it can be easily inserted into a card reader on the laptop or an external attachment. 
    • I find the camera is an invaluable addon to the phone for the sheer easy of access. 
    • Maybe can have a dedicated button to start the camera. 
  • It will not be touch based. 
    • For the limited functionality, touch is not required. 
  • FM radio
    • This is a good requirement as it really used by a lot of people. I do not know why high end phones do not come with FM radio.
  • Casing/Screen properties
    • Screen should be big so as to have a lot of display area. I would want 2/3 of the front to be screen. 
    • On not using the phone, the screen should show : 
      • The current time
        • Can be enhanced for multiple timezones / sunrise/moonrise/etc. 
      • The FM radio station if playing 
        • Only the FM should be controllable via a trackball/pad.
      • Missed calls/sms incoming status. 
        • When incoming call, the entire screen area should be having the details of the caller from the Phone book. 
          • Font should be easily readable from arms length.
    • On activating the phone: 
      • Same as on not using the phone, but now can select the different rows of activities to check them out. 
      • Pressing numbers should instantly start the phonebook lookup based on number and letters
    • It should be eInk
      • Colour eInk if the phone has a camera
      • Else b/w eInk. 
  • Waterproof casing for isntances of using the phone in rain. Normally, with today's phones we cannot. 
  • Touch casing of the phone so that if you drop it, it does not crack. 
Would all this be achievable within 5k INR ? 

Do you think that such a basic phone will have a market ? 

Tiger Tiger

Disclaimer : Major Philosophical Rant.

TIGER, tiger, burning bright  
In the forests of the night,  
What immortal hand or eye  
Could frame thy fearful symmetry?  

In what distant deeps or skies         
Burnt the fire of thine eyes?  
On what wings dare he aspire?  
What the hand dare seize the fire?  

And what shoulder and what art  
Could twist the sinews of thy heart?
And when thy heart began to beat,  
What dread hand and what dread feet?  

What the hammer? what the chain?  
In what furnace was thy brain?  
What the anvil? What dread grasp
Dare its deadly terrors clasp?  

When the stars threw down their spears,  
And water'd heaven with their tears,  
Did He smile His work to see?  
Did He who made the lamb make thee?

Tiger, tiger, burning bright  
In the forests of the night,  
What immortal hand or eye  
Dare frame thy fearful symmetry?
- William Blake

It is one of the most endangered species on earth. It is also the most royal ones. This was the 2nd time in my life that I have seen the tiger face to face in the wild - and both the times it has been in Ranthambore Wildlife Sanctuary - one of the few haunts left for the tiger. 

You can describe what you see. Take a few pictures in the gathering dusk. But you cannot share the feeling you get when you see the magnificent creature staring at you, as though looking into the depths of your soul. 

It was a transformational journey to the jungles of rajasthan and the chance meeting with the Tigers. You see, once you see them, you are left wondering what the heck am I doing ? Is the deskjob - where you spend the entire time of your life replying to emails - life ? Comeon, there has to be more into it. Its like the mist of gadgets, conversations, pressing demands lift, and you suddenly catch a glimpse of something beyond the mist, something you suddenly feel gives a larger meaning to life. 

Questions . Questions. Questions. 

Why do people poach the magnificent creature ? Cant they see anything beyond their greed ? 

Why do corporations and businesses want to denude and permanently destroy the jungles ? 

Why do we just keep doing our job without thinking of the bigger picture of life ? 

Questions that I have no answer for. But the seed of thought has been watered. Life is more than what we live in our apparently busy lives. Life is more than consumer greed and running after the next gadget. Life is happening all around us and we are ignoring it.