0

I'm building a small Flask app that will have user login, and a few other pages that will allow the user to run queries against a database.

Using the Flask User basic app as an example, I put togther a skeleton of the app, and it is working fine locally. Then in an attempt to deploy at as my first Flask app on OpenShift, I follow the guide here (changing flaskapp.py to basic_app.py). For requirements.txt, I add in all the libraries that were required by Flask, Flask User, Flask Login, and some other libraries I will need such as lxml.

When I attempt git push, I get:

remote: Traceback (most recent call last):
remote:   File "/var/lib/openshift/56c60ef92d5271a900000016/python/virtenv/bin/pip", line 12, in <module>
remote:     load_entry_point('pip==1.4.1', 'console_scripts', 'pip')()
remote:   File "/var/lib/openshift/56c60ef92d5271a900000016/app-root/runtime/dependencies/python/virtenv/lib/python2.7/site-packages/pip/__init__.py", line 148, in main
remote:     return command.main(args[1:], options)
remote:   File "/var/lib/openshift/56c60ef92d5271a900000016/app-root/runtime/dependencies/python/virtenv/lib/python2.7/site-packages/pip/basecommand.py", line 171, in main
remote:     log_fp = open_logfile(log_fn, 'w')
remote:   File "/var/lib/openshift/56c60ef92d5271a900000016/app-root/runtime/dependencies/python/virtenv/lib/python2.7/site-packages/pip/basecommand.py", line 200, in open_logfile
remote:     os.makedirs(dirname)
remote:   File "/var/lib/openshift/56c60ef92d5271a900000016/python/virtenv/lib64/python2.7/os.py", line 157, in makedirs
remote:     mkdir(name, mode)
remote: OSError: [Errno 13] Permission denied: '/var/lib/openshift/56c60ef92d5271a900000016/.pip'

When running rhc app create prior to this, I did see the following:

Cloning into 'myflaskapp2'...
The authenticity of host 'myflaskapp2-pyderman.rhcloud.com ' can't be established.
RSA key fingerprint is ......
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'myflaskapp2-pyderman.rhcloud.com' (RSA) to the list of known hosts.

Your application 'myflaskapp2' is now available.

The fact that it finished with 'your application is now available' though would suggest that things are OK with with the SSH key.

I've taken a look at this post, but it doesn't shed any light, as I don't think I am running a "DIY" application (whatever that is).

Any help much appreciated.

Community
  • 1
  • 1
Pyderman
  • 14,809
  • 13
  • 61
  • 106

1 Answers1

0

I know is late but I faced the same problem yesterday and I was able to solve it.

This happens when there's already a socket in the port your app is using. What to do? SSH into you server, kill your app process and push again.

Another option is that you're using the wrong port. You should use the port and IP from the environment variables (if you are using Python: OPENSHIFT_PYTHON_IP and OPENSHIFT_PYTHON_PORT)

About your second question: If you used a custom cartridge or use diy-0.1 cartridge then your app is running over diy. If you used python-2.6, 2.7 or 3.3 then is not.

aaossa
  • 3,763
  • 2
  • 21
  • 34