Paul's Programming Notes     Archive     Feed     Github

"Requested runtime not available for this stack" - Dokku

While using Dokku, I was getting the following error message: Requested runtime (python-2.7.8) is not available for this stack (cedar-14).

This was due to a connection error between my docker container and the internet. To determine this, I ran "docker images" and got the image id of "programium/buildstep", then got into a container with the following command: sudo docker run -t -i <your image id> /bin/bash

Once in the container, I ran:
curl -s

If that is unsuccessful, that should confirm it's a connection issue.

This was the solution to the problem:

Rebuilding Buildstep Image For Dokku From Behind Proxy

I had to change the buildstep image’s docker file to add my proxy. This is because the buildstep image required a proxy before the build to download the python buildpack.

I was rebuilding the buildstep image for dokku with these instructions:

I’m behind a proxy, so I was getting this error when I ran “sudo make build”:

Cloning into ‘heroku-buildpack-multi’… fatal: unable to access ‘’: Failed to connect to port 443: Connection timed out

The solution? Replace the Dockerfile in the root of the folder you git cloned with this:

Troubleshooting Pip Timeout - Python

Timeout: (<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x27330d0>, 'Connection to timed out. (connect timeout=15)')

If you're installing several requirements from a requirements.txt file, it helps to use "-v" after your pip install command to figure out which module has the timeout. Most likely, it's trying to download a module from a URL that doesn't exist.

NULL values excluded from NOT IN - SQLAlchemy+SQLite

Solution: AND column IS NOT NULL

Example: query.filter(or_(~self.column.in_(value), self.column == None))

This thread explains "SQL Server in treating NULL as a value":

Guide To Syncing Fork With Original Project

From my fork, I ran these commands:

  1. git remote add upstream
  2. git fetch upstream
  3. git merge upstream/master
  4. git push
Create new branch and sync with upstream (change the bolded text):
  1. git remote add upstream
  2. git fetch upstream
  3. git checkout -b issue_xxxx upstream/master

Configuring Notepad++ For Python

On the Settings->"Preferences", "Tab Settings" tab, I set "[Default]" at Tab size: 8, uncheck Replace by space; and set "Python" to uncheck Use default value, Tab size: 4, check Replace by space. This causes inserts into a python source to use 4 spaces for indents, and indent with spaces instead of tabs. 
If I end up with any tabs in the source, I use Edit->Blank Operations->TAB to Space to convert them. I also clean up trailing blanks with Edit->Blank Operations->Trim Trailing Space. 
I install and use the pep8 package to verify standard formatting.

Redirecting From Within Helper Functions - Flask