I have installed a CKAN Instance and I have installed the ckanext-showcase module.
Although the installation didn't raise any errors and I was able to add a few showcases when some of my users that I had set as showcase administrators started adding showcases the module has stopped working.
The page {portal.url/showcase} can't be viewed unless I am connected as system administrator. When a user or even a showcase user tries to enter the page get's an internal server error.
From that point on when I am trying to create a new system administrator from console with the paster command (http://docs.ckan.org/en/latest/maintaining/getting-started.html#create-admin-user) I get the bellow message
Traceback (most recent call last):
File "/usr/lib/ckan/default/lib/python2.7/site.py", line 703, in
main()
File "/usr/lib/ckan/default/lib/python2.7/site.py", line 683, in main
paths_in_sys = addsitepackages(paths_in_sys)
File "/usr/lib/ckan/default/lib/python2.7/site.py", line 282, in addsitepackages
addsitedir(sitedir, known_paths)
File "/usr/lib/ckan/default/lib/python2.7/site.py", line 204, in addsitedir
addpackage(sitedir, name, known_paths)
File "/usr/lib/ckan/default/lib/python2.7/site.py", line 173, in addpackage
exec(line)
File "", line 1, in
KeyError: 'ckanext'
Because I don't have the ability to install the CKAN again right now, is there any suggestions on how I to fix this?
Any help would be greatly appreciated
After looking to my server error logs I found that the error wasn't caused by the plugin ckanext-showcase but from the module ckanext-datarequests.
The first part of my problem was connected to a server error coming at a 401 Unauthorized exception not being handled at version 1.0.2 of the plugin. As soon as I upgraded to the latest version 1.0.3 the error was fixed.
Related
after updating the Werkzeug version from 2.0.3 to 2.1.0, I keep getting errors every time I run the server, and here is the error log:
Exception happened during processing of request from ('127.0.0.1', 44612)
Traceback (most recent call last):
File "/usr/lib/python3.8/socketserver.py", line 683, in process_request_thread
self.finish_request(request, client_address)
File "/usr/lib/python3.8/socketserver.py", line 360, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python3.8/socketserver.py", line 747, in __init__
self.handle()
File "/home/oladhari/.virtualenvs/reachat/lib/python3.8/site-packages/werkzeug/serving.py", line 363, in handle
super().handle()
File "/usr/lib/python3.8/http/server.py", line 427, in handle
self.handle_one_request()
File "/usr/lib/python3.8/http/server.py", line 415, in handle_one_request
method()
File "/home/oladhari/.virtualenvs/reachat/lib/python3.8/site-packages/werkzeug/serving.py", line 243, in run_wsgi
self.environ = environ = self.make_environ()
File "/home/oladhari/.virtualenvs/reachat/lib/python3.8/site-packages/django_extensions/management/commands/runserver_plus.py", line 326, in make_environ
del environ['werkzeug.server.shutdown']
KeyError: 'werkzeug.server.shutdown'
this exception keep appearing while incrementing by 2 ( ('127.0.0.1', 44612) -> ('127.0.0.1', 44628) and the server crash
checking the changes log, I have found this detail:
Remove previously deprecated code. #2276
Remove the non-standard shutdown function from the WSGI environ when running the development server. See the docs for alternatives.
here is the link to the changes log
it asks to check the documentation for alternatives but can not find any
please let me know how I would resolve this error, thank you
NB: my python version is 3.8
Literally just ran into this today. According to their (git repo issue 1715) and assuming you are running runserver_plus, there are three options that worked for some users. The first worked for me:
Not altering your files and adding the option --keep-meta-shutdown. My full command looks like python manage.py runserver_plus --cert-file /path/to/cert.pem --key-file /path/to/key.pem --keep-meta-shutdown localhost:9000
Comment out open lines 325 and 326 under your runserver_plus.py
Upgrading python to 3.10
Hope this helps!
The Django-extensions issue for this recommends running runserver_plus with the --keep-meta-shutdown argument.
Alternatively, you can just downgrade Werkzeug to 2.0.* until this is fixed:
pip install Werkzeug==2.0.*
If using a requirements.txt file, use the following:
Werkzeug==2.0.*
This image will help you to find the issue I have configured Openstack newton on ubunu 16.04 LTS. It works fine
Now i have planned to integrate Murano in to this.
All progressed fine..When i am running dashboard using "tox -e venv -- python manage.py runserver <IP:PORT>" command. I am able to run the murano dashboard.
When i am accessing environment tab it displaying error
Error: There was an error communicating with server.
And log message displays an error
No module named memcache
For your reference error message below:
Traceback (most recent call last):
File "/root/murano/murano/murano/api/middleware/fault.py", line 130, in
process_request
return req.get_response(self.application)
File "/root/murano/murano/.tox/venv/local/lib/python2.7/site-packages/webob/request.py",
line 1299, in send
application, catch_exc_info=False)
File "/root/murano/murano/.tox/venv/local/lib/python2.7/site-packages/webob/request.py",
line 1263, in call_application
app_iter = application(self.environ,
start_response)
File "/root/murano/murano/.tox/venv/local/lib/python2.7/site-packages/webob/dec.py",
line 130, in __call__
resp = self.call_func(req, *args,
**self.kwargs)
File "/root/murano/murano/.tox/venv/local/lib/python2.7/site-packages/webob/dec.py",
line 195, in call_func
return self.func(req, *args, **kwargs)
File "/root/murano/murano/.tox/venv/local/lib/python2.7/site-packages/keystonemiddleware/auth_token/__init__.py",
line 320, in __call__
response = self.process_request(req)
File "/root/murano/murano/.tox/venv/local/lib/python2.7/site-packages/keystonemiddleware/auth_token/__init__.py",
line 552, in process_request
resp = super(AuthProtocol,
self).process_request(request)
File "/root/murano/murano/.tox/venv/local/lib/python2.7/site-packages/keystonemiddleware/auth_token/__init__.py",
line 348, in process_request
data, user_auth_ref =
self._do_fetch_token(request.user_token)
File "/root/murano/murano/.tox/venv/local/lib/python2.7/site-packages/keystonemiddleware/auth_token/__init__.py",
line 388, in _do_fetch_token
data = self.fetch_token(token)
File "/root/murano/murano/.tox/venv/local/lib/python2.7/site-packages/keystonemiddleware/auth_token/__init__.py",
line 661, in fetch_token
cached =
self._cache_get_hashes(token_hashes)
File "/root/murano/murano/.tox/venv/local/lib/python2.7/site-packages/keystonemiddleware/auth_token/__init__.py",
line 644, in _cache_get_hashes
cached =
self._token_cache.get(token)
File "/root/murano/murano/.tox/venv/local/lib/python2.7/site-packages/keystonemiddleware/auth_token/_cache.py",
line 214, in get
with self._cache_pool.reserve() as cache:
File "/usr/lib/python2.7/contextlib.py", line 17, in __enter__
return self.gen.next()
File "/root/murano/murano/.tox/venv/local/lib/python2.7/site-packages/keystonemiddleware/auth_token/_cache.py",
line 78, in reserve
import memcache
ImportError: No module named memcache
Can someone help on this?
Thanks in Advance.
Just installing memcached is not enough. You will also need to install python memcache module which is provided separately by python-memcache and python-pymemcache. I am not sure which one is used here.
You can try installing them with apt-get and see which one works for you.
Now working.. I have installed murano api and murano dashboard in different venv.
I have missed to install memcache in munano api venv. When i'm tried after install memcache in murano api venv..Now working fine..
#tutuDajuju Thanks for the Help...
Django CMS 3.4.1
Django 1.10.2
pip modules: http://pastebin.com/vJWvZVfA
pip 8.1.2
Python 2.7.12
OS: Amazon Linux AMI release 2016.03
I'm new to Django CMS, Django, and Python. My previous CMS experience has been with WordPress and I'm try to try out Django CMS as an alternative to WordPress, but am getting an error that I can not seem to figure out. I have updated the pip modules and installed others as suggested in threads on StackOverflow, but to no avail.
I followed the tutorial the instructions, with the exception of the djangocms command, which is incorrect in the tutorial. (It's missing the -w flag.)
EDIT: As requested, here is the output with the --verbose flag added:
(env)[ec2-user#(redacted) tutorial-project]$ djangocms -d postgres://(redacted) -e no --permissions yes -l "en-CA, en-US, en, fr-CA, fr-FR" -p . --starting-page yes --verbose --utc mysite
Creating the project
Please wait while I install dependencies
Package install command: install django-cms<3.5 djangocms-admin-style>=1.2,<1.3 django-treebeard>=4.0,<5.0 psycopg2 djangocms-text-ckeditor>=3.2.1 djangocms-link>=1.8 djangocms-style>=1.7 djangocms-googlemap>=0.5 djangocms-snippet>=1.9 djangocms-video>=2.0 djangocms-column>=1.6 easy_thumbnails django-filer>=1.2 cmsplugin-filer>=1.1 Django<1.9 pytz django-classy-tags>=0.7 html5lib>=0.999999,<0.99999999 Pillow>=3.0 django-sekizai>=0.9 django-select2<5.0six
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-duWZSN/psycopg2/
The installation has failed.
*****************************************************************
Check documentation at https://djangocms-installer.readthedocs.io
*****************************************************************
Traceback (most recent call last):
File "/home/ec2-user/env/bin/djangocms", line 11, in <module>
sys.exit(execute())
File "/home/ec2-user/env/local/lib/python2.7/site-packages/djangocms_installer/main.py", line 33, in execute
verbose=config_data.verbose
File "/home/ec2-user/env/local/lib/python2.7/site-packages/djangocms_installer/install/__init__.py", line 91, in requirements
output = subprocess.check_output(['pip'] + args)
File "/usr/lib64/python2.7/subprocess.py", line 574, in check_output
raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '[u'pip', u'install', u'django-cms<3.5', u'djangocms-admin-style>=1.2,<1.3', u'django-treebeard>=4.0,<5.0', u'psycopg2', u'djangocms-text-ckeditor>=3.2.1', u'djangocms-link>=1.8', u'djangocms-style>=1.7', u'djangocms-googlemap>=0.5', u'djangocms-snippet>=1.9', u'djangocms-video>=2.0', u'djangocms-column>=1.6', u'easy_thumbnails', u'django-filer>=1.2', u'cmsplugin-filer>=1.1', u'Django<1.9', u'pytz', u'django-classy-tags>=0.7', u'html5lib>=0.999999,<0.99999999', u'Pillow>=3.0', u'django-sekizai>=0.9', u'django-select2<5.0six']' returned non-zero exit status 1
EDIT 2: (moved to answer)
EDIT 3:
After solving the first part, another error remains. I'll include it in this post since it still falls under the topic of the title:
Creating the project
Project creation command: /home/ec2-user/env/bin/python2.7 /home/ec2-user/env/bin/django-admin.py startproject mysite /home/ec2-user/tutorial-project
Database setup commands: /home/ec2-user/env/bin/python2.7 -W ignore manage.py migrate
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/home/ec2-user/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 354, in execute_from_command_line
utility.execute()
File "/home/ec2-user/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 346, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/ec2-user/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 394, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/ec2-user/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 445, in execute
output = self.handle(*args, **options)
File "/home/ec2-user/env/local/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 93, in handle
executor = MigrationExecutor(connection, self.migration_progress_callback)
File "/home/ec2-user/env/local/lib/python2.7/site-packages/django/db/migrations/executor.py", line 19, in __init__
self.loader = MigrationLoader(self.connection)
File "/home/ec2-user/env/local/lib/python2.7/site-packages/django/db/migrations/loader.py", line 47, in __init__
self.build_graph()
File "/home/ec2-user/env/local/lib/python2.7/site-packages/django/db/migrations/loader.py", line 191, in build_graph
self.applied_migrations = recorder.applied_migrations()
File "/home/ec2-user/env/local/lib/python2.7/site-packages/django/db/migrations/recorder.py", line 59, in applied_migrations
self.ensure_schema()
File "/home/ec2-user/env/local/lib/python2.7/site-packages/django/db/migrations/recorder.py", line 49, in ensure_schema
if self.Migration._meta.db_table in self.connection.introspection.table_names(self.connection.cursor()):
File "/home/ec2-user/env/local/lib/python2.7/site-packages/django/db/backends/base/base.py", line 162, in cursor
cursor = self.make_debug_cursor(self._cursor())
File "/home/ec2-user/env/local/lib/python2.7/site-packages/django/db/backends/base/base.py", line 135, in _cursor
self.ensure_connection()
File "/home/ec2-user/env/local/lib/python2.7/site-packages/django/db/backends/base/base.py", line 130, in ensure_connection
self.connect()
File "/home/ec2-user/env/local/lib/python2.7/site-packages/django/db/backends/base/base.py", line 118, in connect
conn_params = self.get_connection_params()
File "/home/ec2-user/env/local/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 158, in get_connection_params
"settings.DATABASES is improperly configured. "
django.core.exceptions.ImproperlyConfigured: settings.DATABASES is improperly configured. Please supply the NAME value.
The installation has failed.
*****************************************************************
Check documentation at https://djangocms-installer.readthedocs.io
*****************************************************************
Traceback (most recent call last):
File "/home/ec2-user/env/bin/djangocms", line 11, in <module>
sys.exit(execute())
File "/home/ec2-user/env/local/lib/python2.7/site-packages/djangocms_installer/main.py", line 41, in execute
django.setup_database(config_data)
File "/home/ec2-user/env/local/lib/python2.7/site-packages/djangocms_installer/django/__init__.py", line 388, in setup_database
output = subprocess.check_output(command, env=env)
File "/usr/lib64/python2.7/subprocess.py", line 574, in check_output
raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['/home/ec2-user/env/bin/python2.7', u'-W', u'ignore', u'manage.py', u'migrate']' returned non-zero exit status 1
I'm going to guess that the problem lies in the message:
settings.DATABASES is improperly configured. Please supply the NAME value.
The installation has failed.
I'm using PostgreSQL, so I assume that the error is caused by the schema not being provided in the command argument. There was nothing in the guide that I saw indicating how to provide it, so I'll have to search some more.
The error message tells me absolutely nothing. It only tells me that Django tried to use pip to install something and for whatever reason it failed. In order to figure out what went wrong, try enabling verbose mode (python -v). If that gives the same output, or that isn't an option because you're using a program that calls Python (which it sounds like you are), let me know and prepare to go into the source code. Trust me, I have taken many a dive into source code for Python utilities, and as long as you don't do anything stupid (like delete a file) it's pretty hard to mess anything up. Even if you do you can always reinstall Django (or make a backup first). Don't worry about messing up your computer. You'd have to work hard to make Django do that!
Original error
The non-verbose error message indicates the error in a cryptic way, and using --verbose provides a more understandable message.
I was missing one required module (psycopg2) and four others were versions which were too new (easy_thumbnails, Django, html5lib, django-select2).
I uninstalled the four modules and then reinstalled them using the version requirement in the command. e.g. pip install 'Django<1.10'.
psycopg2 required extra steps, as I got an error message when trying to install it indicating that it could not find pg_config. Another SO answer advised that I just had to install postgresql-devel. After I did that, (sudo yum install postgresql-devel), I also uninstalled postgresql8-libs, as postgresql-devel came with a newer version. I didn't do it before since yum indicated a PHP dependency, and I wasn't sure if it would cause problems if I did.
Second error
Pretty simple. I was missing the /NAME component of the database URL (postgres://USER:PASSWORD#HOST:PORT/NAME).
I have installed Anaconda (Python 2.7) in Windows 7. Initially, it was a bit problematic to start spyder, but eventually I figured out that by running cmd as administrator, spyder starts. As soon as I ran my first python script in Spyder, it showed me an error in its internal console:
F:\PythonIDE\lib\site-packages\nbformat\current.py:19: UserWarning: nbformat.current is deprecated.
- use nbformat for read/write/validate public API
- use nbformat.vX directly to composing notebooks of a particular version
""")
F:\PythonIDE\lib\pkgutil.py:110: FutureWarning: The pandas.rpy module is deprecated and will be removed in a future version. We refer to external packages like rpy2.
See here for a guide on how to port your code to rpy2: http://pandas.pydata.org/pandas-docs/stable/r_interface.html
__import__(name)
F:\PythonIDE\lib\site-packages\matplotlib\cbook.py:137: MatplotlibDeprecationWarning: The matplotlib.delaunay module was deprecated in version 1.4. Use matplotlib.tri.Triangulation instead.
warnings.warn(message, mplDeprecation, stacklevel=1)
F:\PythonIDE\lib\site-packages\skimage\filter\__init__.py:6: skimage_deprecation: The `skimage.filter` module has been renamed to `skimage.filters`. This placeholder module will be removed in v0.13.
warn(skimage_deprecation('The `skimage.filter` module has been renamed '
Failed to write user configuration file.
Please submit a bug report.
Traceback (most recent call last):
File "F:\PythonIDE\lib\site-packages\spyderlib\plugins\editor.py", line 2066, in run_file
dialog.setup(fname)
File "F:\PythonIDE\lib\site-packages\spyderlib\plugins\runconfig.py", line 349, in setup
self.runconfigoptions = RunConfigOptions(self)
File "F:\PythonIDE\lib\site-packages\spyderlib\plugins\runconfig.py", line 148, in __init__
self.runconf = RunConfiguration()
File "F:\PythonIDE\lib\site-packages\spyderlib\plugins\runconfig.py", line 57, in __init__
self.set(CONF.get('run', 'defaultconfiguration', default={}))
File "F:\PythonIDE\lib\site-packages\spyderlib\userconfig.py", line 387, in get
self.set(section, option, default)
File "F:\PythonIDE\lib\site-packages\spyderlib\userconfig.py", line 446, in set
self._save()
File "F:\PythonIDE\lib\site-packages\spyderlib\userconfig.py", line 136, in _save
raise(e)
WindowsError: [Error 5] Access is denied: u'C:\\Users\\Shubhanshu\\.spyder2\\spyder.ini'
Now, how to rectify this error? I would be really grateful for any help in this regard.
I use google drive application wrote a desktop application using python and everything works fine. But when I use pyinstaller to output a .exe file and run that application. A problem occurs on these lines:
if credentials is None or credentials.invalid:
credentials = run(FLOW, storage)
The authentication page shows and I allow its access. Unlike usual, there is no response after that and I found that the .exe program exits with no reason.
Anyone met this problem before? If so, how to solve it?
P.S. I traced the error now and it is as follows:
Traceback (most recent call last):
File "<string>", line 697, in <module>
File "<string>", line 562, in __init__
File "build\bdist.win32\egg\oauth2client\tools.py", line 166, in run
File "build\bdist.win32\egg\oauth2client\client.py", line 1069, in step2_exchange
File "USB\build\pyi.win32\USB\outPYZ1.pyz/httplib2", line 1544, in request
File "USB\build\pyi.win32\USB\outPYZ1.pyz/httplib2", line 1294, in _request
File "USB\build\pyi.win32\USB\outPYZ1.pyz/httplib2", line 1230, in _conn_request
File "USB\build\pyi.win32\USB\outPYZ1.pyz/httplib2", line 984, in connect
File "USB\build\pyi.win32\USB\outPYZ1.pyz/httplib2", line 80, in _ssl_wrap_socket
File "USB\build\pyi.win32\USB\outPYZ1.pyz/ssl", line 381, in wrap_socket
File "USB\build\pyi.win32\USB\outPYZ1.pyz/ssl", line 141, in __init__
ssl.SSLError: [Errno 185090050] _ssl.c:340: error:0B084002:x509 certificate rout
ines:X509_load_cert_crl_file:system lib
I saw someone encountered the similar error http://code.google.com/p/google-api-python-client/issues/detail?id=58 but the reply said it already fixed it.
I also tried the method in https://github.com/kennethreitz/requests/issues/557 but it is not working.
Does anyone know how to fix it?
I'm guessing, but this is possible related to STDIN handling on Windows exe from pyinstaller - usually this won't be available to you, so you might have to run your own custom flow.
But you can narrow it down to either:
Reading/writing from STDIN/STDOUT
Starting a local web server
Launching a browser
Since all those need to be performed when running a flow locally, and one of them is going wrong for you.
If you log STDERR to a text file, you will be able to see which part is crashing.
After digging a little bit, I found the solution based on solution provided by Dropbox api developer: https://forums.dropbox.com/topic.php?id=65523&replies=1#post-461457. This problem is basically caused by:
CA_CERTS = os.path.join(os.path.dirname(os.path.abspath(__file__ )), "cacerts.txt")
__file__ is the key that causes this problem. It cannot work normally in the executable program to find the path.
Similar problem can be found here: pyinstaller seems not to find a data file
In order to solve this problem, I change the above code into this:
CA_CERTS = os.path.join(os.path.dirname(sys.executable), "cacerts.txt")
By doing this, the .exe program will try to find cacerts.txt in the directory where .exe file is located. After compiling this into .pyc, I put cacerts.txt into .exe directory. Then the program can run normally.