Forums

[flask] Cant get my app to run and error logs arent that helpful

Hello, im having a problem trying to deploy my app, here are the logs:

server.logs

2016-02-21 19:32:06 *** Starting uWSGI 2.0.5.1 (64bit) on [Sun Feb 21 19:32:06 2016] ***
2016-02-21 19:32:06 compiled with version: 4.8.4 on 25 January 2016 13:41:27
2016-02-21 19:32:06 os: Linux-3.13.0-76-generic #120-Ubuntu SMP Mon Jan 18 15:59:10 UTC 2016
2016-02-21 19:32:06 nodename: conrad-liveweb6
2016-02-21 19:32:06 machine: x86_64
2016-02-21 19:32:06 clock source: unix
2016-02-21 19:32:06 pcre jit disabled
2016-02-21 19:32:06 detected number of CPU cores: 4
2016-02-21 19:32:06 current working directory: /etc/uwsgi/vassals
2016-02-21 19:32:06 detected binary path: /usr/local/bin/uwsgi
2016-02-21 19:32:06 *** dumping internal routing table ***
2016-02-21 19:32:06 [rule: 0] subject: path_info regexp: \.svgz$ action: addheader:Content-Encoding:gzip
2016-02-21 19:32:06 *** end of the internal routing table ***
2016-02-21 19:32:06 using Linux cgroup /mnt/cgroups/cpu/user_types/custom with mode 700
2016-02-21 19:32:06 assigned process 24955 to cgroup /mnt/cgroups/cpu/user_types/custom/tasks
2016-02-21 19:32:06 using Linux cgroup /mnt/cgroups/cpuacct/domains/www.abdul.mx with mode 700
2016-02-21 19:32:06 assigned process 24955 to cgroup /mnt/cgroups/cpuacct/domains/www.abdul.mx/tasks
2016-02-21 19:32:06 using Linux cgroup /mnt/cgroups/memory/domains/www.abdul.mx with mode 700
2016-02-21 19:32:06 assigned process 24955 to cgroup /mnt/cgroups/memory/domains/www.abdul.mx/tasks
2016-02-21 19:32:06 uWSGI running as root, you can use --uid/--gid/--chroot options
2016-02-21 19:32:06 chroot() to /mnt/chroots/abdulachik
2016-02-21 19:32:06 setgid() to 60000
2016-02-21 19:32:06 setuid() to 1296030
2016-02-21 19:32:06 limiting number of processes to 30...
2016-02-21 19:32:06 your processes number limit is 30
2016-02-21 19:32:06 your memory page size is 4096 bytes
2016-02-21 19:32:06 detected max file descriptor number: 123456
2016-02-21 19:32:06 building mime-types dictionary from file /etc/mime.types...
2016-02-21 19:32:06 536 entry found
2016-02-21 19:32:06 lock engine: pthread robust mutexes
2016-02-21 19:32:06 thunder lock: disabled (you can enable it with --thunder-lock)
2016-02-21 19:32:06 uwsgi socket 0 bound to UNIX address /var/sockets/www.abdul.mx/socket fd 7
2016-02-21 19:32:06 Python version: 2.7.6 (default, Jun 22 2015, 18:01:27)  [GCC 4.8.2]
2016-02-21 19:32:06 *** Python threads support is disabled. You can enable it with --enable-threads ***
2016-02-21 19:32:06 Python main interpreter initialized at 0x128ae20
2016-02-21 19:32:06 your server socket listen backlog is limited to 100 connections
2016-02-21 19:32:06 your mercy for graceful operations on workers is 60 seconds
2016-02-21 19:32:06 setting request body buffering size to 65536 bytes
2016-02-21 19:32:06 mapped 500928 bytes (489 KB) for 2 cores
2016-02-21 19:32:06 *** Operational MODE: preforking ***
2016-02-21 19:32:06 WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0x128ae20 pid: 24955 (default app)
2016-02-21 19:32:06 *** uWSGI is running in multiple interpreter mode ***
2016-02-21 19:32:06 spawned uWSGI master process (pid: 24955)
2016-02-21 19:32:06 spawned uWSGI worker 1 (pid: 24956, cores: 1)
2016-02-21 19:32:06 spawned 2 offload threads for uWSGI worker 1
2016-02-21 19:32:06 spawned uWSGI worker 2 (pid: 24959, cores: 1)
2016-02-21 19:32:06 spawned 2 offload threads for uWSGI worker 2
2016-02-21 19:32:08 announcing my loyalty to the Emperor...

error.logs

2016-02-21 19:32:08,861 :/usr/lib/python2.7/threading.py:1160: RuntimeWarning: tp_compare didn't return -1 or -2 for exception
2016-02-21 19:32:08,862 :  return _active[_get_ident()]
2016-02-21 19:32:08,862 :Traceback (most recent call last):
2016-02-21 19:32:08,862 :  File "/bin/user_wsgi_wrapper.py", line 134, in __call__
2016-02-21 19:32:08,862 :    self.error_log_file.logger.exception("Error running WSGI application")
2016-02-21 19:32:08,862 :  File "/usr/lib/python2.7/logging/__init__.py", line 1185, in exception
2016-02-21 19:32:08,863 :    self.error(msg, *args, **kwargs)
2016-02-21 19:32:08,863 :  File "/usr/lib/python2.7/logging/__init__.py", line 1178, in error
2016-02-21 19:32:08,863 :    self._log(ERROR, msg, args, **kwargs)
2016-02-21 19:32:08,863 :  File "/usr/lib/python2.7/logging/__init__.py", line 1270, in _log
2016-02-21 19:32:08,864 :    record = self.makeRecord(self.name, level, fn, lno, msg, args, exc_info, func, extra)
2016-02-21 19:32:08,864 :  File "/usr/lib/python2.7/logging/__init__.py", line 1244, in makeRecord
2016-02-21 19:32:08,864 :    rv = LogRecord(name, level, fn, lno, msg, args, exc_info, func)
2016-02-21 19:32:08,864 :  File "/usr/lib/python2.7/logging/__init__.py", line 284, in __init__
2016-02-21 19:32:08,864 :    self.threadName = threading.current_thread().name
2016-02-21 19:32:08,865 :  File "/usr/lib/python2.7/threading.py", line 1160, in currentThread
2016-02-21 19:32:08,865 :    return _active[_get_ident()]
2016-02-21 19:32:08,865 :  File "/bin/user_wsgi_wrapper.py", line 126, in __call__
2016-02-21 19:32:08,865 :    app_iterator = self.app(environ, start_response)
2016-02-21 19:32:08,865 :  File "/bin/user_wsgi_wrapper.py", line 140, in import_error_application
2016-02-21 19:32:08,865 :    raise e
2016-02-21 19:32:08,866 :ImportError: No module named shortcuts
2016-02-21 19:32:17,632 :Traceback (most recent call last):
2016-02-21 19:32:17,632 :  File "/bin/user_wsgi_wrapper.py", line 134, in __call__
2016-02-21 19:32:17,632 :    self.error_log_file.logger.exception("Error running WSGI application")
2016-02-21 19:32:17,632 :  File "/usr/lib/python2.7/logging/__init__.py", line 1185, in exception
2016-02-21 19:32:17,633 :    self.error(msg, *args, **kwargs)
2016-02-21 19:32:17,633 :  File "/usr/lib/python2.7/logging/__init__.py", line 1178, in error
2016-02-21 19:32:17,633 :    self._log(ERROR, msg, args, **kwargs)
2016-02-21 19:32:17,633 :  File "/usr/lib/python2.7/logging/__init__.py", line 1270, in _log
2016-02-21 19:32:17,633 :    record = self.makeRecord(self.name, level, fn, lno, msg, args, exc_info, func, extra)
2016-02-21 19:32:17,633 :  File "/usr/lib/python2.7/logging/__init__.py", line 1244, in makeRecord
2016-02-21 19:32:17,634 :    rv = LogRecord(name, level, fn, lno, msg, args, exc_info, func)
2016-02-21 19:32:17,634 :  File "/usr/lib/python2.7/logging/__init__.py", line 284, in __init__
2016-02-21 19:32:17,634 :    self.threadName = threading.current_thread().name
2016-02-21 19:32:17,634 :  File "/usr/lib/python2.7/threading.py", line 1160, in currentThread
2016-02-21 19:32:17,634 :    return _active[_get_ident()]
2016-02-21 19:32:17,634 :  File "/bin/user_wsgi_wrapper.py", line 126, in __call__
2016-02-21 19:32:17,634 :    app_iterator = self.app(environ, start_response)
2016-02-21 19:32:17,635 :  File "/bin/user_wsgi_wrapper.py", line 140, in import_error_application
2016-02-21 19:32:17,635 :    raise e
2016-02-21 19:32:17,635 :ImportError: No module named shortcuts

i cant really tell whats wrong, i tried to log into the console and run the app doing:

python app.py

and it worked, i also tried running my models.py to create all my models and it worked aswell, they are all on mysql now but i cant make it work and i mean that when i click www.abdul.mx it says:

Something went wrong :-(

This website is hosted by PythonAnywhere, an online hosting environment. Something went wrong while trying to load it; please try again later.

If this is your PythonAnywhere-hosted site, there may be a bug in your code. Check your site's server and error logs for any messages — you can view them from the Web tab inside PythonAnywhere.

You'll find a series of tips on how to debug problems, and solutions to common issues on our Help pages

If you get completely stuck, then drop us a line at support@pythonanywhere.com, in the forums, or using the "Send feedback" link on the site, quoting the error code below.

Error code: Unhandled Exception

im using flask, python2.7, peewee and some flask packages that i installed manually using pip

am i missing something? i already clicked the green button: reload

thanks for your help!

it works now, i specified the virtualenv i was using inside the dashboard and now it works! srry for this post!