reticentroot
reticentroot

Reputation: 3682

OpenShift Error The requested URL / was not found on this server

I've been trying to deploy a flask app on openshift. I tested the website and it runs just fine on the development server (both by typing python app.py and manage.py runserver), I uploaded the project to github and created the app using this command from terminal:

rhc create-app marcsantiago python-2.7 --from-code=https://github.com/marcsantiago/personalwebsite.git

The app seems to be created without a problem. The issue occurs when I try and visit the created url:

http://marcsantiago-mywebappsflask.rhcloud.com

I receive a not found error The requested URL / was not found on this server.

I don't understand what i did wrong or how to fix it so that the website it live. It is a simple website, which uses no databases.

Could someone please help me resolve this issue?

this the postgresql.log information, though i'm not sure how relevant it is since i don't use a database, python.log is below

2015-07-22 02:05:44 GMT LOG:  could not bind socket for statistics collector: Permission denied
2015-07-22 02:05:44 GMT LOG:  trying another address for the statistics collector
2015-07-22 02:05:44 GMT LOG:  could not bind socket for statistics collector: Cannot assign requested address
2015-07-22 02:05:44 GMT LOG:  disabling statistics collector for lack of working socket
2015-07-22 02:05:44 GMT WARNING:  autovacuum not started because of misconfiguration
2015-07-22 02:05:44 GMT HINT:  Enable the "track_counts" option.
2015-07-22 02:05:44 GMT LOG:  database system was shut down at 2013-05-21 05:07:11 GMT
2015-07-22 02:05:44 GMT LOG:  database system is ready to accept connections
2015-07-22 02:05:48 GMT LOG:  received smart shutdown request
2015-07-22 02:05:48 GMT LOG:  shutting down
2015-07-22 02:05:48 GMT LOG:  database system is shut down
2015-07-22 02:06:04 GMT LOG:  could not bind socket for statistics collector: Permission denied
2015-07-22 02:06:04 GMT LOG:  trying another address for the statistics collector
2015-07-22 02:06:04 GMT LOG:  could not bind socket for statistics collector: Cannot assign requested address
2015-07-22 02:06:04 GMT LOG:  disabling statistics collector for lack of working socket
2015-07-22 02:06:04 GMT WARNING:  autovacuum not started because of misconfiguration
2015-07-22 02:06:04 GMT HINT:  Enable the "track_counts" option.
2015-07-22 02:06:04 GMT LOG:  database system was shut down at 2015-07-22 02:05:48 GMT
2015-07-22 02:06:04 GMT LOG:  database system is ready to accept connections

python.log

[Tue Jul 21 22:06:07 2015] [notice] SELinux policy enabled; httpd running as context unconfined_u:system_r:openshift_t:s0:c6,c294
[Tue Jul 21 22:06:07 2015] [notice] Digest: generating secret for digest authentication ...
[Tue Jul 21 22:06:07 2015] [notice] Digest: done
[Tue Jul 21 22:06:07 2015] [notice] Apache/2.2.15 (Unix) mod_wsgi/3.4 Python/2.7.8 configured -- resuming normal operations
(98)Address already in use: make_sock: could not bind to address 127.12.133.129:8080
no listening sockets available, shutting down
Unable to open logs
[Tue Jul 21 22:07:01 2015] [error] [client 127.12.133.129] Target WSGI script not found or unable to stat: /var/lib/openshift/55aefa434382ecece2000001/app-root/runtime/repo/wsgi, referer: http://stackoverflow.com/questions/31551797/openshift-error-the-requested-url-was-not-found-on-this-server/31552667
67.84.182.205 - - [21/Jul/2015:22:07:01 -0400] "GET / HTTP/1.1" 404 304 "http://stackoverflow.com/questions/31551797/openshift-error-the-requested-url-was-not-found-on-this-server/31552667" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/600.6.3 (KHTML, like Gecko) Version/8.0.6 Safari/600.6.3"
[Tue Jul 21 22:08:49 2015] [error] [client 127.12.133.129] Target WSGI script not found or unable to stat: /var/lib/openshift/55aefa434382ecece2000001/app-root/runtime/repo/wsgi, referer: http://stackoverflow.com/questions/31551797/openshift-error-the-requested-url-was-not-found-on-this-server/31552667?noredirect=1
124.32.215.10 - - [21/Jul/2015:22:08:49 -0400] "GET / HTTP/1.1" 404 304 "http://stackoverflow.com/questions/31551797/openshift-error-the-requested-url-was-not-found-on-this-server/31552667?noredirect=1" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/600.7.12 (KHTML, like Gecko) Version/8.0.7 Safari/600.7.12"
[Tue Jul 21 22:08:50 2015] [error] [client 127.12.133.129] Target WSGI script not found or unable to stat: /var/lib/openshift/55aefa434382ecece2000001/app-root/runtime/repo/wsgi, referer: http://marcsantiago-mywebappsflask.rhcloud.com/
124.32.215.10 - - [21/Jul/2015:22:08:50 -0400] "GET /favicon.ico HTTP/1.1" 404 315 "http://marcsantiago-mywebappsflask.rhcloud.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/600.7.12 (KHTML, like Gecko) Version/8.0.7 Safari/600.7.12"
[Tue Jul 21 22:10:25 2015] [error] [client 127.12.133.129] Target WSGI script not found or unable to stat: /var/lib/openshift/55aefa434382ecece2000001/app-root/runtime/repo/wsgi
10.99.163.186 - - [21/Jul/2015:22:10:25 -0400] "HEAD / HTTP/1.1" 404 - "-" "Ruby"
10.99.163.186 - - [21/Jul/2015:22:10:25 -0400] "HEAD / HTTP/1.1" 404 - "-" "Ruby"
[Tue Jul 21 22:10:25 2015] [error] [client 127.12.133.129] Target WSGI script not found or unable to stat: /var/lib/openshift/55aefa434382ecece2000001/app-root/runtime/repo/wsgi

sorry for how messy it looks, couldn't think of a better way to share the logs other than pasting them in.

Upvotes: 1

Views: 1462

Answers (2)

user2879327
user2879327

Reputation:

Have you tried reading through the section of the Developer Portal that is about using Flask on OpenShift Online?

https://developers.openshift.com/en/python-flask.html

Upvotes: 1

0x90
0x90

Reputation: 6259

The domain is not pointing to any server.

This is most likely an issue in your configuration on Openshift, an error in their server configuration or a mistyping of the URL on your side.

Contact Openshift or check their logs.

Edit: Looking at the new logs, it becomes clear that the server can't find your WSGI app. You mention that it is called app.py, but the server may be looking for something else. The more common file name would be application.py. Check your configuration at OpenShift and adjust the WSGI application file name accordingly.

Upvotes: 0

Related Questions