I am not able to setup WebRTC on Google App Engine. Here are the steps that I performed to deploy the webrtc app on my Google App Engine Project.
Clone https://github.com/webrtc/apprtc on my local system.
Copied app.yaml from apprtc/src/app_engine/ to root folder of the local repository
Edited app.yaml [Set "application" to my appid "ckwebrtc" on Google App Engine]
npm install
grunt build
appcfg.py --oauth2 update
But I am getting "500 Server Error - The server encountered an error and could not complete your request".
URL - https://ckwebrtc.appspot.com/
Kindly help
Update: This is the error that I am getting:
2015-04-16 22:34:26 Running command: "['C:\\Python27\\pythonw.exe', '-u', 'C:\\Program Files\\Google\\google_appengine\\appcfg.py', '--oauth2', 'update', u'C:\\xampp\\htdocs\\heroku\\ckwebrtc']"
10:34 PM Application: ckwebrtc; version: 2
10:34 PM Host: appengine.google.com
10:34 PM Starting update of app: ckwebrtc, version: 2
10:34 PM Getting current resource limits.
10:34 PM Scanning files on local disk.
10:34 PM Scanned 500 files.
10:35 PM Scanned 1000 files.
10:35 PM Scanned 1500 files.
10:35 PM Scanned 2000 files.
2015-04-16 22:36:05,130 ERROR appcfg.py:1925 Invalid character in filename: node_modules/grunt-htmlhint/node_modules/htmlhint/node_modules/jshint/node_modules/shelljs/test/resources/ls/filename(with)[chars$]^that.must+be-escaped
10:36 PM Scanned 2500 files.
10:36 PM Scanned 3000 files.
10:36 PM Scanned 3500 files.
10:36 PM Scanned 4000 files.
10:36 PM Scanned 4500 files.
10:36 PM Scanned 5000 files.
10:36 PM Scanned 5500 files.
2015-04-16 22:36:55,687 ERROR appcfg.py:2454 An error occurred processing file '': [Error 3] The system cannot find the path specified: 'C:\\xampp\\htdocs\\heroku\\ckwebrtc\\node_modules/grunt-closurecompiler/node_modules/closurecompiler/node_modules/tar/node_modules/fstream/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/*.*'. Aborting.
Traceback (most recent call last):
File "C:\Program Files\Google\google_appengine\appcfg.py", line 133, in <module>
run_file(__file__, globals())
File "C:\Program Files\Google\google_appengine\appcfg.py", line 129, in run_file
execfile(_PATHS.script_file(script_name), globals_)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 5468, in <module>
main(sys.argv)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 5459, in main
result = AppCfgApp(argv).Run()
File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 3019, in Run
self.action(self)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 5115, in __call__
return method()
File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 3853, in Update
self._UpdateWithParsedAppYaml(appyaml, self.basepath)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 3906, in _UpdateWithParsedAppYaml
self.UpdateVersion(rpcserver, basepath, appyaml, APP_YAML_FILENAME)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 3791, in UpdateVersion
return appversion.DoUpload(paths, openfunc)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 2445, in DoUpload
self._AddFilesThatAreSmallEnough(paths, openfunc)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 2537, in _AddFilesThatAreSmallEnough
for path in paths:
File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 2680, in FileIterator
entries = set(os.listdir(os.path.join(base, current_dir)))
WindowsError: [Error 3] The system cannot find the path specified: 'C:\\xampp\\htdocs\\heroku\\ckwebrtc\\node_modules/grunt-closurecompiler/node_modules/closurecompiler/node_modules/tar/node_modules/fstream/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/*.*'
2015-04-16 22:36:55 (Process exited with code 1)
You can close this window now.
I am not sure if this was a windows problem or not.
I tried again from koding.com (Online Cloud) and was successful in setting up the app.
Here's how I did it.
$ git clone https://github.com/webrtc/apprtc.git
Edit app.yaml, package.json, mainfest.json etc with your application ID.
$ sudo npm install grunt-cli
$ sudo npm install
$ sudo grunt build
$ sudo python /home/campuskarma/google_appengine/appcfg.py --oauth2 -A ckwebrtc update ./out/app_engine/
If you get an error asking for rollback then execute the following command:
$ sudo python /home/campuskarma/google_appengine/appcfg.py --oauth2 -A ckwebrtc rollback ./out/app_engine/
$ sudo python /home/campuskarma/google_appengine/appcfg.py --oauth2 -A ckwebrtc update ./out/app_engine/
Each of the command mentioned here should be executed from the root of your application folder. (i.e. the folder where your application is cloned)
Related
This the error in my PGAdmin4.
I have deleted data from AppData (Roaming) and also tried to run it as Admisitaror. But no solutions for this problem has been found by me.
I am trying to solve this issue for 2 days but no matter which way I run it is not being solved by me.
I have also added the path to environment variables in Windows but still, it is giving me this error:
pgAdmin Runtime Environment
--------------------------------------------------------
Python Path: "C:\Program Files\PostgreSQL\13\pgAdmin 4\python\python.exe"
Runtime Config File: "C:\Users\RAFI\AppData\Roaming\pgadmin\runtime_config.json"
pgAdmin Config File: "C:\Program Files\PostgreSQL\13\pgAdmin 4\web\config.py"
Webapp Path: "C:\Program Files\PostgreSQL\13\pgAdmin 4\web\pgAdmin4.py"
pgAdmin Command: "C:\Program Files\PostgreSQL\13\pgAdmin 4\python\python.exe -s C:\Program Files\PostgreSQL\13\pgAdmin 4\web\pgAdmin4.py"
Environment:
- ALLUSERSPROFILE: C:\ProgramData
- APPDATA: C:\Users\RAFI\AppData\Roaming
- ChocolateyInstall: C:\ProgramData\chocolatey
- ChocolateyLastPathUpdate: 132568889893646513
- CHROME_CRASHPAD_PIPE_NAME: \\.\pipe\crashpad_9944_NWJOXUOEYVOTZCKP
- CHROME_RESTART: NW.js|Whoa! NW.js has crashed. Relaunch now?|LEFT_TO_RIGHT
- CommonProgramFiles: C:\Program Files\Common Files
- CommonProgramFiles(x86): C:\Program Files (x86)\Common Files
- CommonProgramW6432: C:\Program Files\Common Files
- COMPUTERNAME: NOBOROTNO-09-WP
- ComSpec: C:\WINDOWS\system32\cmd.exe
- DriverData: C:\Windows\System32\Drivers\DriverData
- HOMEDRIVE: C:
- HOMEPATH: \Users\RAFI
- IntelliJ IDEA: C:\Program Files\JetBrains\IntelliJ IDEA 2020.2.1\bin;
- INTEL_DEV_REDIST: C:\Program Files (x86)\Common Files\Intel\Shared Libraries\
- LOCALAPPDATA: C:\Users\RAFI\AppData\Local
- LOGONSERVER: \\NOBOROTNO-09-WP
- MIC_LD_LIBRARY_PATH: C:\Program Files (x86)\Common Files\Intel\Shared Libraries\compiler\lib\mic
- NUMBER_OF_PROCESSORS: 8
- OneDrive: C:\Users\RAFI\OneDrive
- OS: Windows_NT
- Path: C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Android;%JAVA_HOME%\bin;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Git\cmd;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\ProgramData\chocolatey\bin;C:\Program Files\nodejs\;C:\Users\RAFI\AppData\Local\Programs\Python\Python39\Scripts\;C:\Users\RAFI\AppData\Local\Programs\Python\Python39\;C:\Users\RAFI\AppData\Local\Microsoft\WindowsApps;%IntelliJ IDEA Community Edition%;C:\Program Files\JetBrains\IntelliJ IDEA 2019.3.3\bin;C:\Program Files\JetBrains\PyCharm 2019.3.3\bin;C:\Program Files\JetBrains\IntelliJ IDEA 2020.1.1\bin;C:\Users\RAFI\AppData\Local\Microsoft\WindowsApps;C:\Users\RAFI\AppData\Local\Programs\Microsoft VS Code\bin;C:\Program Files\JetBrains\IntelliJ IDEA 2020.2.1\bin;C:\Program Files\JetBrains\PyCharm 2021.1.1\bin;C:\Users\RAFI\Documents\flutter;C:\src\flutter\bin;C:\Users\RAFI\AppData\Roaming\npm
- PATHEXT: .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
- PGADMIN_INT_KEY: b4165b61-33d2-4880-91a7-36803ac38c2d
- PGADMIN_INT_PORT: 59802
- PGADMIN_SERVER_MODE: OFF
- Postgresql: C:\Program Files\PostgreSQL\13\bin\
- PROCESSOR_ARCHITECTURE: AMD64
- PROCESSOR_IDENTIFIER: Intel64 Family 6 Model 142 Stepping 10, GenuineIntel
- PROCESSOR_LEVEL: 6
- PROCESSOR_REVISION: 8e0a
- ProgramData: C:\ProgramData
- ProgramFiles: C:\Program Files
- ProgramFiles(x86): C:\Program Files (x86)
- ProgramW6432: C:\Program Files
- PSModulePath: C:\Users\RAFI\Documents\WindowsPowerShell\Modules;
- PT7HOME: C:\Program Files\Cisco Packet Tracer 7.3.1
- PUBLIC: C:\Users\Public
- PyCharm: C:\Program Files\JetBrains\PyCharm 2021.1.1\bin;
- Python 3.9: C:\Python39\Scripts
- QT_DEVICE_PIXEL_RATIO: auto
- SystemDrive: C:
- SystemRoot: C:\WINDOWS
- TEMP: C:\Users\RAFI\AppData\Local\Temp
- TMP: C:\Users\RAFI\AppData\Local\Temp
- USERDOMAIN: NOBOROTNO-09-WP
- USERDOMAIN_ROAMINGPROFILE: NOBOROTNO-09-WP
- USERNAME: RAFI
- USERPROFILE: C:\Users\RAFI
- windir: C:\WINDOWS
--------------------------------------------------------
NOTE: Configuring authentication for DESKTOP mode.
Traceback (most recent call last):
File "C:\Program Files\PostgreSQL\13\pgAdmin 4\web\pgAdmin4.py", line 91, in <module>
exec(open(file_quote(setup_py), 'r').read())
File "<string>", line 506, in <module>
File "<string>", line 378, in setup_db
File "C:\Program Files\PostgreSQL\13\pgAdmin 4\web\pgadmin\__init__.py", line 351, in create_app
db_upgrade(app)
File "C:\Program Files\PostgreSQL\13\pgAdmin 4\web\pgadmin\setup\db_upgrade.py", line 25, in db_upgrade
flask_migrate.upgrade(migration_folder)
File "C:\Program Files\PostgreSQL\13\pgAdmin 4\python\lib\site-packages\flask_migrate\__init__.py", line 96, in wrapped
f(*args, **kwargs)
File "C:\Program Files\PostgreSQL\13\pgAdmin 4\python\lib\site-packages\flask_migrate\__init__.py", line 271, in upgrade
command.upgrade(config, revision, sql=sql, tag=tag)
File "C:\Program Files\PostgreSQL\13\pgAdmin 4\python\lib\site-packages\alembic\command.py", line 294, in upgrade
script.run_env()
File "C:\Program Files\PostgreSQL\13\pgAdmin 4\python\lib\site-packages\alembic\script\base.py", line 490, in run_env
util.load_python_file(self.dir, "env.py")
File "C:\Program Files\PostgreSQL\13\pgAdmin 4\python\lib\site-packages\alembic\util\pyfiles.py", line 97, in load_python_file
module = load_module_py(module_id, path)
File "C:\Program Files\PostgreSQL\13\pgAdmin 4\python\lib\site-packages\alembic\util\compat.py", line 182, in load_module_py
spec.loader.exec_module(module)
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "C:\Program Files\PostgreSQL\13\pgAdmin 4\web\pgadmin\setup\..\..\migrations\env.py", line 93, in <module>
run_migrations_online()
File "C:\Program Files\PostgreSQL\13\pgAdmin 4\web\pgadmin\setup\..\..\migrations\env.py", line 86, in run_migrations_online
context.run_migrations()
File "<string>", line 8, in run_migrations
File "C:\Program Files\PostgreSQL\13\pgAdmin 4\python\lib\site-packages\alembic\runtime\environment.py", line 813, in run_migrations
self.get_context().run_migrations(**kw)
File "C:\Program Files\PostgreSQL\13\pgAdmin 4\python\lib\site-packages\alembic\runtime\migration.py", line 561, in run_migrations
step.migration_fn(**kw)
File "C:\Program Files\PostgreSQL\13\pgAdmin 4\web\migrations\versions\fdc58d9bd449_.py", line 122, in upgrade
Security(current_app, user_datastore, register_blueprint=False)
File "C:\Program Files\PostgreSQL\13\pgAdmin 4\python\lib\site-packages\flask_security\core.py", line 1062, in __init__
self._state = self.init_app(
File "C:\Program Files\PostgreSQL\13\pgAdmin 4\python\lib\site-packages\flask_security\core.py", line 1102, in init_app
self._state = state = _get_state(app, datastore, **kwargs)
File "C:\Program Files\PostgreSQL\13\pgAdmin 4\python\lib\site-packages\flask_security\core.py", line 608, in _get_state
remember_token_serializer=_get_serializer(app, "remember"),
File "C:\Program Files\PostgreSQL\13\pgAdmin 4\python\lib\site-packages\flask_security\core.py", line 593, in _get_serializer
return URLSafeTimedSerializer(secret_key=secret_key, salt=salt)
File "C:\Program Files\PostgreSQL\13\pgAdmin 4\python\lib\site-packages\itsdangerous\serializer.py", line 104, in __init__
self.secret_keys: _t.List[bytes] = _make_keys_list(secret_key)
File "C:\Program Files\PostgreSQL\13\pgAdmin 4\python\lib\site-packages\itsdangerous\signer.py", line 64, in _make_keys_list
return [want_bytes(s) for s in secret_key]
TypeError: 'NoneType' object is not iterable
previous answers and the related link to the problem mentioned in the comment are not the same as this one. the only similarity is a report of fatal error - but the log is different. I had that problem and none of the answers on that link helped.
I realized that the issue might be in working from Win Pro - as I installed the same versions of PostgresDB and pgadmin on both Windows Pro and Windows Home - with the same updated systems and same security - win home worked and win pro did not. after tracing problems through the log I solved them one by one by checking paths in config file (c:\Program Files\PostgreSQL\10\pgAdmin 4\web or c:\Program Files\pgAdmin 4\web ) wich solved a lot of underlying problems for me. I sometimes give it a temp hardcoded location instead of the constructed paths just to see if the hiccup is there. for example, the code is not registering win pro as a windows machine but a server and it's trying to get the file in a wrong place
About your specific problem, try to trace your errors from the bottom. your request is coming from the line before the error. your last line says that the definition in the given path (signer.py) at line 64 is giving a 'None' result and the script is expecting a non 'None' answer
def _make_keys_list(secret_key: _t_secret_key) -> _t.List[bytes]:
if isinstance(secret_key, (str, bytes)):
return [want_bytes(secret_key)]
return [want_bytes(s) for s in secret_key]
I would trace it back to the request and try to see why it's giving away none. Check your paths in config file.
find "AppData" folder (default it is hidden)
go to - C:\Users\asus_pc\AppData\Roaming
find for "pgadmin" and delete - pgadmin folder
search pgAdmin4 and run (if not working try with run as administator
Like you I tried deleting session data and running the program as administrator, as well as various other posted solutions.
The fix that worked for me was simply increasing the timeout duration to 240 seconds. This can be done from the window showing the error message. At the bottom of this window is a button that allows some config settings to be adjusted.
When I'm visiting my website (https://osm-messaging-platform.appspot.com), I get this error on the main webpage:
502 Bad Gateway. nginx/1.14.0 (Ubuntu).
It's really weird, since when I run it locally
python app.py
I get no errors, and my app and the website load fine.
I've already tried looking it up, but most of the answers I've found on stack overflow either have no errors or don't relate to me. Here is the error when I look at my GCloud logs:
019-02-07 02:07:05 default[20190206t175104] Traceback (most recent
call last): File "/env/lib/python3.7/site-
packages/gunicorn/arbiter.py", line 583, in spawn_worker
worker.init_process() File "/env/lib/python3.7/site-
packages/gunicorn/workers/gthread.py", line 104, in init_process
super(ThreadWorker, self).init_process() File
"/env/lib/python3.7/site-packages/gunicorn/workers/base.py", line
129, in init_process self.load_wsgi() File
"/env/lib/python3.7/site-packages/gunicorn/workers/base.py", line
138, in load_wsgi self.wsgi = self.app.wsgi() File
"/env/lib/python3.7/site-packages/gunicorn/app/base.py", line 67, in
wsgi self.callable = self.load() File
"/env/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 52,
in load return self.load_wsgiapp() File
"/env/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 41,
in load_wsgiapp return util.import_app(self.app_uri) File
"/env/lib/python3.7/site-packages/gunicorn/util.py", line 350, in
import_app __import__(module) ModuleNotFoundError: No module
named 'main'
2019-02-07 02:07:05 default[20190206t175104] [2019-02-07 02:07:05
+0000] [25] [INFO] Worker exiting (pid: 25)
2019-02-07 02:07:05 default[20190206t175104] [2019-02-07 02:07:05
+0000] [8] [INFO] Shutting down: Master
2019-02-07 02:07:05 default[20190206t175104] [2019-02-07 02:07:05
+0000] [8] [INFO] Reason: Worker failed to boot.
And here are the contents of my app.yaml file:
runtime: python37
handlers:
# This configures Google App Engine to serve the files in the app's
static
# directory.
- url: /static
static_dir: static
- url: /.*
script: auto
I expected it to show my website, but it didn't. Can anyone help?
The error is produced because the App Engine Standard Python37 runtime handles the requests in the main.py file by default. I guess that you don't have this file and you are handling the requests in the app.py file.
Also the logs traceback is pointing to it: ModuleNotFoundError: No module named 'main'
Change the name the name of the app.py file to main.py and try again.
As a general rule it is recommended to follow this file structure present in the App Engine Standard documention:
your-app/
app.yaml
main.py
requirements.txt
static/
script.js
style.css
templates/
index.html
I believe this would be overkill for your situation but If you need a custom entrypoint read this Python3 runtime documentation to know more about how to configure it.
My mistake was naming the main app "main" which conflicted with main.py. It worked fine locally as it did not use main.py. I changed it to root and everything worked fine. It took me a whole day to solve it out.
I resolved the issue in main.py by changing the host from:
app.run(host="127.0.0.1", port=8080, debug=True)
to
app.run(host="0.0.0.0", port=8080, debug=True)
I'm trying to create a cluster with version 3.4, but it keeps giving me an error. The strange thing is that if I try to do it with version 2.1.5 for example, everything runs smoothly.
So for instance if I try to create a cluster with ccm create -v 3.4 -n 3 mycluster
This is what I get:
WARN:Downloading 3.4 failed, due to [Errno 2] No such file or directory. Trying to build from git instead.
http://git-wip-us.apache.org/repos/asf/cassandra.git git:cassandra-3.4
Cloning Cassandra...
Traceback (most recent call last):
File "/usr/local/bin/ccm", line 5, in <module>
pkg_resources.run_script('ccm==2.1.4', 'ccm')
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 528, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1401, in run_script
exec(script_code, namespace, namespace)
File "/usr/local/lib/python2.7/dist-packages/ccm-2.1.4-py2.7.egg/EGG-INFO/scripts/ccm", line 74, in <module>
File "build/bdist.linux-x86_64/egg/ccmlib/cmds/cluster_cmds.py", line 158, in run
File "build/bdist.linux-x86_64/egg/ccmlib/cluster.py", line 63, in __init__
File "build/bdist.linux-x86_64/egg/ccmlib/cluster.py", line 76, in load_from_repository
File "build/bdist.linux-x86_64/egg/ccmlib/repository.py", line 77, in setup
File "build/bdist.linux-x86_64/egg/ccmlib/repository.py", line 203, in clone_development
ccmlib.common.CCMError: Building C* version git:cassandra-3.4 failed. Attempted to delete /home/pedro/.ccm/repository/gitCOLONcassandra-3.4 but failed. This will need to be manually deleted
However if I do ls -a /home/pedro/.ccm/repository/ -l, I don't see the folder that had to be manually deleted according to the stacktrace:
total 12
drwxrwxr-x 3 pedro pedro 4096 Mar 25 18:01 .
drwxrwxr-x 3 pedro pedro 4096 Mar 25 17:59 ..
drwxrwxr-x 9 pedro pedro 4096 Mar 25 17:36 2.1.5
-rw-rw-r-- 1 pedro pedro 0 Mar 25 17:59 last.log
I tried your cluster creation and it works fine for me. I have git 2.5.4 installed might be worth looking at your version of git. I would also look at your java version and update it if you are behind.
Ok, so it was one of those problems... On my .profile (I'm on Ubuntu), I was initializing the JAVA_HOME, after the PATH, so when the PATH was export the value "JAVA_HOME/bin" didn't existed.
Although it's somewhat embarassing, I'm maintaning this post up, because I couldn't possibly figure this out from the output of the error, so maybe this can help someone out.
I ran into this error as well, however my solution was different:
kill the current cassandra process:
sudo ps auwx | grep cassandra
sudo kill -9 PID
stop the ccm as well:
ccm stop
remove the current cluster:
ccm remove
build a cluster with the same version of Cassandra that you are running
ccm create mycluster -v 3.9 -n 3
im running a fabric script that, amongst other things, is supposed to restart gunicorn on an ubuntu server, the command is below:
supervisorctl status projectname:gunicorn | sed "s/.*[pid ]\([0-9]\+\)\,.*/\1/" | xargs kill -HUP
the problem is, is that gunicorn doesnt appear to be running in the first place so the process cannot be killed, ive ssh'd into the amazon ec2 instance and ran
sudo supervisorctl restart projectname:gunicorn'
and I get an error response that says:
projectname:gunicorn: ERROR (not running)
projectname:gunicorn ERROR (abnormal termination)
so i attempted to start gunicorn by running
sudo supervisorctl start projectname:gunicorn
and the error says
'projectname:gunicorn: Error (abnormal termination)'
So I need gunicorn to run, and im having trouble acheiving this
Ive also checked the gunicorn log and the text below, below is the relevant output
2014-01-17 14:58:14 [12260] [INFO] Starting gunicorn 0.14.3
2014-01-17 14:58:14 [12260] [INFO] Listening at: http://127.0.0.1:9000 (12260)
2014-01-17 14:58:14 [12260] [INFO] Using worker: sync
2014-01-17 14:58:14 [12263] [INFO] Booting worker with pid: 12263
2014-01-17 14:58:14 [12264] [INFO] Booting worker with pid: 12264
2014-01-17 14:58:14 [12265] [INFO] Booting worker with pid: 12265
2014-01-17 14:58:14 [12266] [INFO] Booting worker with pid: 12266
2014-01-17 14:58:14 [12263] [INFO] Worker exiting (pid: 12263)
2014-01-17 14:58:14 [12264] [INFO] Worker exiting (pid: 12264)
2014-01-17 14:58:14 [12265] [INFO] Worker exiting (pid: 12265)
2014-01-17 14:58:14 [12266] [INFO] Worker exiting (pid: 12266)
Traceback (most recent call last):
File "/opt/screening/env/bin/gunicorn_django", line 9, in <module>
load_entry_point('gunicorn==0.14.3', 'console_scripts', 'gunicorn_django')()
File "/opt/compliance_engine/env/local/lib/python2.7/site-packages/gunicorn/app/djangoapp.py", line 129, in run
DjangoApplication("%prog [OPTIONS] [SETTINGS_PATH]").run()
File "/opt/compliance_engine/env/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 129, in run
Arbiter(self).run()
File "/opt/compliance_engine/env/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 184, in run
self.halt(reason=inst.reason, exit_status=inst.exit_status)
File "/opt/compliance_engine/env/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 279, in halt
self.stop()
File "/opt/compliance_engine/env/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 327, in stop
self.reap_workers()
File "/opt/compliance_engine/env/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 413, in reap_workers
raise HaltServer(reason, self.WORKER_BOOT_ERROR)
gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
also, here is the conf file
[program:gunicorn]
command=/opt/screening/env/bin/gunicorn_django --pythonpath . ce.settings -w 4 --bind 127.0.0.1:9000
directory=/opt/screening/repository
user=www-data
autostart=true
autorestart=true
stdout_logfile=/opt/screening/logs/gunicorn.log
redirect_stderr=true
[program:celeryd]
command=/opt/screening/env/bin/python manage.py celeryd --autoscale=16,2 -E -l INFO --pidfile=/opt/screening/tmp/pids/celeryd.pid
directory=/opt/screening/repository
user=www-data
autostart=true
autorestart=true
stdout_logfile=/opt/screening/logs/celeryd.log
redirect_stderr=true
[program:celerybeat]
command=/opt/screening/env/bin/python manage.py celerybeat -l INFO -- schedule=/opt/screening/tmp/celerybeat-schedule -- pidfile=/opt/screening/tmp/pids/celerybeat.pid
directory=/opt/screening/repository
user=www-data
autostart=true
autorestart=true
stdout_logfile=/opt/screening/logs/celerybeat.log
redirect_stderr=true
[program:celerycam]
command=/opt/screening/env/bin/python manage.py celerycam -- pidfile=/opt/screening/tmp/pids/celerycam.pid
directory=/opt/screening/repository
user=www-data
autostart=true
autorestart=true
stdout_logfile=/opt/screening/logs/celerycam.log
redirect_stderr=true
[group:screening]
programs=gunicorn,celeryd,celerybeat,celerycam
any ideas? I understand that this is a lot of text, any hints or pointers would be much appreciated
Thanks for reading,
edit:
ran unicorn on its own, activated the virtual env and ran
python manage.py run_gunicorn
the terminal printed the below output
2014-01-19 22:02:35 [14735] [INFO] Starting gunicorn 0.14.3
2014-01-19 22:02:35 [14735] [INFO] Listening at: http://127.0.0.1:8000 (14735)
2014-01-19 22:02:35 [14735] [INFO] Using worker: sync
2014-01-19 22:02:35 [14742] [INFO] Booting worker with pid: 14742
also ran the run server in the virtualenv:
python manage.py runserver 7000
Validating models...
0 errors found
Django version 1.3, using settings 'ce.settings'
Development server is running at http://127.0.0.1:7000/
Quit the server with CONTROL-C.
so no apparent errors there
edit 2:
have spoken to a couple other people about this, and was advised to look at the permissions for the gunicorn logs, here they are:
-rw-rw-r-- 1 www-data ubuntu 3270504 2014-01-19 23:23 gunicorn.log
the www-data user matches the one set in the supervisor config
edit 3: I ran the gunicorn command again, but this time added logging info:
gunicorn_django --pythonpath . ce.settings -w 4 --bind 127.0.0.1:9000 --debug --log-level debug
and received the following error message:
Traceback (most recent call last):
File "/opt/screening/env/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 453, in spawn_worker
worker.init_process()
File "/opt/screening/env/local/lib/python2.7/site-packages/gunicorn/workers/base.py", line 99, in init_process
self.wsgi = self.app.wsgi()
File "/opt/screening/env/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 101, in wsgi
self.callable = self.load()
File "/opt/screening/env/local/lib/python2.7/site-packages/gunicorn/app/djangoapp.py", line 87, in load
mod = util.import_module("gunicorn.app.django_wsgi")
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/opt/screening/env/local/lib/python2.7/site-packages/gunicorn/app/django_wsgi.py", line 18, in <module>
from django.core.management.validation import get_validation_errors
File "/opt/screening/env/local/lib/python2.7/site-packages/django/core/management/validation.py", line 3, in <module>
from django.contrib.contenttypes.generic import GenericForeignKey, GenericRelation
File "/opt/screening/env/local/lib/python2.7/site-packages/django/contrib/contenttypes/generic.py", line 6, in <module>
from django.db import connection
File "/opt/screening/env/local/lib/python2.7/site-packages/django/db/__init__.py", line 14, in <module>
if not settings.DATABASES:
File "/opt/screening/env/local/lib/python2.7/site-packages/django/utils/functional.py", line 276, in __getattr__
self._setup()
File "/opt/screening/env/local/lib/python2.7/site-packages/django/conf/__init__.py", line 42, in _setup
self._wrapped = Settings(settings_module)
File "/opt/screening/env/local/lib/python2.7/site-packages/django/conf/__init__.py", line 89, in __init__
raise ImportError("Could not import settings '%s' (Is it on sys.path?): %s" % (self.SETTINGS_MODULE, e))
ImportError: Could not import settings 'ce.settings' (Is it on sys.path?): No module named ce.settings
2014-01-20 09:14:22 [31830] [INFO] Worker exiting (pid: 31830)
Traceback (most recent call last):
File "/opt/screening/env/bin/gunicorn_django", line 9, in <module>
load_entry_point('gunicorn==0.14.3', 'console_scripts', 'gunicorn_django')()
File "/opt/screening/env/local/lib/python2.7/site-packages/gunicorn/app/djangoapp.py", line 129, in run
DjangoApplication("%prog [OPTIONS] [SETTINGS_PATH]").run()
File "/opt/screening/env/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 129, in run
Arbiter(self).run()
File "/opt/screening/env/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 184, in run
self.halt(reason=inst.reason, exit_status=inst.exit_status)
File "/opt/screening/env/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 279, in halt
self.stop()
File "/opt/screening/env/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 327, in stop
self.reap_workers()
File "/opt/screening/env/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 413, in reap_workers
raise HaltServer(reason, self.WORKER_BOOT_ERROR)
gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
so it appears that the salient info is this:
ImportError: Could not import settings 'ce.settings' (Is it on sys.path?): No module named ce.settings
My settings are in a settings directory, and the init file is present, so the issue isnt that.
Also the application starts on the runserver so the settings file must be importable
(The question was answered by the OP in a question edit. Converted to a community wiki answer. See Question with no answers, but issue solved in the comments (or extended in chat) )
The OP wrote:
Solved the issue (I think)
as per the info in this link https://stackoverflow.com/a/19256794/2049067 , I added the project to the python path
export PYTHONPATH=:/my/path
then ran the gunicorn command again:
gunicorn_django --pythonpath . ce.settings -w 4 --bind 127.0.0.1:9000 --debug --log-level debug
and gunicorn is up and running, and the site is accessible, I exited the ssh and everything is (seemingly) still working. I should also add that before I set the pythonpath I changed the ownerwhip on the gunicorn log:
sudo chown -R www-data:www-data gunicorn.log
Though I dont know if that helped
& seeing how the application has been running for years I dont know how the project was removed from the pythonpath
I've just installed python 3.2.1 (32-bit) and cherrypy 3.2.1 (CherryPy-3.2.1.win32-py3.exe) on my Windows 7 box and have tried the hello world example (executed via PyScripter) but it hangs after the Engine bus STARTED message.
If I try to start it via the python.exe, I get the following log:
C:\Program Files (x86)\Python32>python hello.py
[24/Jul/2011:16:24:03] ENGINE Listening for SIGTERM.
[24/Jul/2011:16:24:03] ENGINE Bus STARTING
CherryPy Checker:
The Application mounted at '' has an empty config.
[24/Jul/2011:16:24:03] ENGINE Started monitor thread 'Autoreloader'.
[24/Jul/2011:16:24:03] ENGINE Started monitor thread '_TimeoutMonitor'.
[24/Jul/2011:16:24:03] ENGINE Serving on 127.0.0.1:8080
[24/Jul/2011:16:24:03] ENGINE Bus STARTED
Exception in thread CP Server Thread-4:
Traceback (most recent call last):
File "C:\Program Files (x86)\Python32\lib\site-packages\cherrypy\wsgiserver\ws
giserver3.py", line 693, in read_request_headers
read_headers(self.rfile, self.inheaders)
File "C:\Program Files (x86)\Python32\lib\site-packages\cherrypy\wsgiserver\ws
giserver3.py", line 202, in read_headers
raise ValueError("Illegal end of headers.")
ValueError: Illegal end of headers.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Program Files (x86)\Python32\lib\site-packages\cherrypy\wsgiserver\ws
giserver3.py", line 1024, in communicate
req.parse_request()
File "C:\Program Files (x86)\Python32\lib\site-packages\cherrypy\wsgiserver\ws
giserver3.py", line 578, in parse_request
success = self.read_request_headers()
File "C:\Program Files (x86)\Python32\lib\site-packages\cherrypy\wsgiserver\ws
giserver3.py", line 696, in read_request_headers
self.simple_response("400 Bad Request", ex.args[0])
File "C:\Program Files (x86)\Python32\lib\site-packages\cherrypy\wsgiserver\ws
giserver3.py", line 840, in simple_response
status = str(status)
TypeError: 'tuple' object is not callable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Program Files (x86)\Python32\lib\threading.py", line 736, in _bootstr
ap_inner
self.run()
File "C:\Program Files (x86)\Python32\lib\site-packages\cherrypy\wsgiserver\ws
giserver3.py", line 1174, in run
conn.communicate()
File "C:\Program Files (x86)\Python32\lib\site-packages\cherrypy\wsgiserver\ws
giserver3.py", line 1080, in communicate
req.simple_response("500 Internal Server Error", format_exc())
File "C:\Program Files (x86)\Python32\lib\site-packages\cherrypy\wsgiserver\ws
giserver3.py", line 840, in simple_response
status = str(status)
TypeError: 'tuple' object is not callable
What am I missing?
Code:
import cherrypy
class HelloWorld:
def index(self):
return "Hello world"
index.exposed = True
cherrypy.quickstart(HelloWorld())
EDIT: Bonus-info: I've tried various things to remedy the situation with no result. Installing the 64-bit version of python didn't help as cherrypy doesn't support 64-bit (unless, I'm mistaken). I've tried re-installing both python and the cherrypy packages, and I've tried deactivating all other things that might block it (IIS). All to no avail :-(
EDIT2: Second bonus - everything works if I install it with python 2.7.2, so seems it is only a problem with 3.x (I've tried 3.0.1 as well - same problem)
I have encountered two errors:
1 - open your browser before starting the script, so you'll not have any problem.
2 - if you use a personal firewall or an antivirus that handles HTTP protection, be sure he is not protecting the 8080 port, for example ESET Antivirus will not let you use the 8080 and CherryPy will say that the port is not free.