Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

500 Error Upon Production Deployment #1111

Closed
wants to merge 48 commits into from
Closed

500 Error Upon Production Deployment #1111

wants to merge 48 commits into from

Conversation

tobes
Copy link
Contributor

@tobes tobes commented Jul 16, 2013

Hi everyone,

I was able to get CKAN working just fine locally, but trying to deploy per the instructions (http://docs.ckan.org/en/latest/deployment.html) gives me a 500 error. I checked permissions and everything is correct. Here's the log:

[Mon Jul 15 20:31:51 2013] [error] [client 198.211.103.157] mod_wsgi (pid=17063): Target WSGI script '/etc/ckan/default/apache.wsgi' cannot be loaded as Python module.
[Mon Jul 15 20:31:51 2013] [error] [client 198.211.103.157] mod_wsgi (pid=17063): Exception occurred processing WSGI script '/etc/ckan/default/apache.wsgi'.
[Mon Jul 15 20:31:51 2013] [error] [client 198.211.103.157] Traceback (most recent call last):
[Mon Jul 15 20:31:51 2013] [error] [client 198.211.103.157]   File "/etc/ckan/default/apache.wsgi", line 9, in <module>
[Mon Jul 15 20:31:51 2013] [error] [client 198.211.103.157]     application = loadapp('config:%s' % config_filepath)
[Mon Jul 15 20:31:51 2013] [error] [client 198.211.103.157]   File "/usr/lib/ckan/default/lib/python2.6/site-packages/paste/deploy/loadwsgi.py", line 247, in loadapp
[Mon Jul 15 20:31:51 2013] [error] [client 198.211.103.157]     return loadobj(APP, uri, name=name, **kw)
[Mon Jul 15 20:31:51 2013] [error] [client 198.211.103.157]   File "/usr/lib/ckan/default/lib/python2.6/site-packages/paste/deploy/loadwsgi.py", line 272, in loadobj
[Mon Jul 15 20:31:51 2013] [error] [client 198.211.103.157]     return context.create()
[Mon Jul 15 20:31:51 2013] [error] [client 198.211.103.157]   File "/usr/lib/ckan/default/lib/python2.6/site-packages/paste/deploy/loadwsgi.py", line 710, in create
[Mon Jul 15 20:31:51 2013] [error] [client 198.211.103.157]     return self.object_type.invoke(self)
[Mon Jul 15 20:31:51 2013] [error] [client 198.211.103.157]   File "/usr/lib/ckan/default/lib/python2.6/site-packages/paste/deploy/loadwsgi.py", line 146, in invoke
[Mon Jul 15 20:31:51 2013] [error] [client 198.211.103.157]     return fix_call(context.object, context.global_conf, **context.local_conf)
[Mon Jul 15 20:31:51 2013] [error] [client 198.211.103.157]   File "/usr/lib/ckan/default/lib/python2.6/site-packages/paste/deploy/util.py", line 56, in fix_call
[Mon Jul 15 20:31:51 2013] [error] [client 198.211.103.157]     val = callable(*args, **kw)
[Mon Jul 15 20:31:51 2013] [error] [client 198.211.103.157]   File "/usr/lib/ckan/default/src/ckan/ckan/config/middleware.py", line 54, in make_app
[Mon Jul 15 20:31:51 2013] [error] [client 198.211.103.157]     load_environment(conf, app_conf)
[Mon Jul 15 20:31:51 2013] [error] [client 198.211.103.157]   File "/usr/lib/ckan/default/src/ckan/ckan/config/environment.py", line 177, in load_environment
[Mon Jul 15 20:31:51 2013] [error] [client 198.211.103.157]     config['routes.map'] = routing.make_map()
[Mon Jul 15 20:31:51 2013] [error] [client 198.211.103.157]   File "/usr/lib/ckan/default/src/ckan/ckan/config/routing.py", line 100, in make_map
[Mon Jul 15 20:31:51 2013] [error] [client 198.211.103.157]     map = plugin.before_map(map)
[Mon Jul 15 20:31:51 2013] [error] [client 198.211.103.157]   File "/usr/lib/ckan/default/src/ckan/ckanext/datastore/plugin.py", line 248, in before_map
[Mon Jul 15 20:31:51 2013] [error] [client 198.211.103.157]     print "Load mapping"
[Mon Jul 15 20:31:51 2013] [error] [client 198.211.103.157] IOError: sys.stdout access restricted by mod_wsgi
[Mon Jul 15 20:31:55 2013] [error] [client 198.211.103.157] mod_wsgi (pid=17064): Target WSGI script '/etc/ckan/default/apache.wsgi' cannot be loaded as Python module.
[Mon Jul 15 20:31:55 2013] [error] [client 198.211.103.157] mod_wsgi (pid=17064): Exception occurred processing WSGI script '/etc/ckan/default/apache.wsgi'.
[Mon Jul 15 20:31:55 2013] [error] [client 198.211.103.157] Traceback (most recent call last):
[Mon Jul 15 20:31:55 2013] [error] [client 198.211.103.157]   File "/etc/ckan/default/apache.wsgi", line 9, in <module>
[Mon Jul 15 20:31:55 2013] [error] [client 198.211.103.157]     application = loadapp('config:%s' % config_filepath)
[Mon Jul 15 20:31:55 2013] [error] [client 198.211.103.157]   File "/usr/lib/ckan/default/lib/python2.6/site-packages/paste/deploy/loadwsgi.py", line 247, in loadapp
[Mon Jul 15 20:31:55 2013] [error] [client 198.211.103.157]     return loadobj(APP, uri, name=name, **kw)
[Mon Jul 15 20:31:55 2013] [error] [client 198.211.103.157]   File "/usr/lib/ckan/default/lib/python2.6/site-packages/paste/deploy/loadwsgi.py", line 272, in loadobj
[Mon Jul 15 20:31:55 2013] [error] [client 198.211.103.157]     return context.create()
[Mon Jul 15 20:31:55 2013] [error] [client 198.211.103.157]   File "/usr/lib/ckan/default/lib/python2.6/site-packages/paste/deploy/loadwsgi.py", line 710, in create
[Mon Jul 15 20:31:55 2013] [error] [client 198.211.103.157]     return self.object_type.invoke(self)
[Mon Jul 15 20:31:55 2013] [error] [client 198.211.103.157]   File "/usr/lib/ckan/default/lib/python2.6/site-packages/paste/deploy/loadwsgi.py", line 146, in invoke
[Mon Jul 15 20:31:55 2013] [error] [client 198.211.103.157]     return fix_call(context.object, context.global_conf, **context.local_conf)
[Mon Jul 15 20:31:55 2013] [error] [client 198.211.103.157]   File "/usr/lib/ckan/default/lib/python2.6/site-packages/paste/deploy/util.py", line 56, in fix_call
[Mon Jul 15 20:31:55 2013] [error] [client 198.211.103.157]     val = callable(*args, **kw)
[Mon Jul 15 20:31:55 2013] [error] [client 198.211.103.157]   File "/usr/lib/ckan/default/src/ckan/ckan/config/middleware.py", line 54, in make_app
[Mon Jul 15 20:31:55 2013] [error] [client 198.211.103.157]     load_environment(conf, app_conf)
[Mon Jul 15 20:31:55 2013] [error] [client 198.211.103.157]   File "/usr/lib/ckan/default/src/ckan/ckan/config/environment.py", line 177, in load_environment
[Mon Jul 15 20:31:55 2013] [error] [client 198.211.103.157]     config['routes.map'] = routing.make_map()
[Mon Jul 15 20:31:55 2013] [error] [client 198.211.103.157]   File "/usr/lib/ckan/default/src/ckan/ckan/config/routing.py", line 100, in make_map
[Mon Jul 15 20:31:55 2013] [error] [client 198.211.103.157]     map = plugin.before_map(map)
[Mon Jul 15 20:31:55 2013] [error] [client 198.211.103.157]   File "/usr/lib/ckan/default/src/ckan/ckanext/datastore/plugin.py", line 248, in before_map
[Mon Jul 15 20:31:55 2013] [error] [client 198.211.103.157]     print "Load mapping"
[Mon Jul 15 20:31:55 2013] [error] [client 198.211.103.157] IOError: sys.stdout access restricted by mod_wsgi
[Mon Jul 15 20:36:53 2013] [error] Exception KeyError: KeyError(140103623919424,) in <module 'threading' from '/usr/lib/python2.6/threading.pyc'> ignored
[Mon Jul 15 20:36:53 2013] [error] Exception KeyError: KeyError(140103623919424,) in <module 'threading' from '/usr/lib/python2.6/threading.pyc'> ignored
[Mon Jul 15 20:36:54 2013] [error] Exception AttributeError: "'NoneType' object has no attribute 'clearing'" in <bound method PluginEnvironment.__del__ of  Services for Environment '<default>'
[Mon Jul 15 20:36:54 2013] [error] > ignored
[Mon Jul 15 20:36:54 2013] [error] Exception AttributeError: "'NoneType' object has no attribute 'clearing'" in <bound method PluginEnvironment.__del__ of  Services for Environment '<default>'
[Mon Jul 15 20:36:54 2013] [error] > ignored
[Mon Jul 15 20:36:59 2013] [error] Load mapping
[Mon Jul 15 20:37:02 2013] [error] 2013-07-15 20:37:02,827 INFO  [ckan.lib.base]  / render time 2.856 seconds

amercader and others added 30 commits June 26, 2013 17:28
Adds new helper function to check if a resource can be previewed and adds it to
the templates.
Also fixes for:
* Group/Org edit template: added missing context in sidebar
* Group/Org new template: added missing helper text
* Small template refactors: moving group context info into snippet and also
group/org helpers into snippets
Add tests that no activities are emitted when creating, updating or
deleting private datasets via the API.

These could be more detailed, e.g. test adding, deleting and updating
groups as well, or moving the dataset between groups or between orgs, or
testing what happens when a private dataset is made public or
vice-versa.
Move the visibility option (public or private) when creating a dataset
to the first stage of the dataset creation form. This fixes the issue
(#953) that an activity is emitted when creating private datasets. Since
the dataset is actually created when the first form is submitted, and
the public/private setting is not chosen until the third form, the
dataset is public at the moment when it's created and an activity is
emitted.

It seems to make a lot more sense fo the visibility option to be on the
first form next to the organization option anyway.

Fixes #953.
If a dataset has no owner organization, authorize anyone to read that
dataset (regardless of whether it's public or private).
Fix the logic for displaying the Organization and Visibility dropdowns
when creating or updating a dataset.

We really need frontend tests for this.

I tested these cases manually:

User is not logged in and anon_create_dataset = True: neither
Organization nor Visibility shows, either when creating or when updating
a dataset.

User is logged in, but is not a member of any organization: neither
Organization nor Visibility shows, either when creating or when updating
a dataset. Tested both when the site has no organizations and when the
site does have orgs but user is not a member of any.

User is logged in, and is a member of an organization: Both Organization
and Visibility show when creating a dataset.

When creating a private dataset, no activities appear in the activity
stream.

User is logged in, and is a member of an organization, but dataset is
not a member of any org: neither Organization nor Visibility shows when
updating a dataset.

User is logged in, and is a member of an organization, and dataset is a
member of any org: Visibility shows but Organization does not show when
updating a dataset.

User is sysadmin, site has no orgs: neither Organization nor Visibility
shows when creating or updating a dataset.

User is sysadmin, site does have orgs: both Organization and Visibility
show when creating or updating a dataset.
Don't allow non-sysadmins to read inactive datasets.

This fixes a test that was failing.
Add a validator to prevent private datasets with no organization from
being created by package_create or package_update.

Conflicts:

	ckan/logic/schema.py
	ckan/logic/validators.py
Essentially we get the current value of the visibility dropdown and then if no
org is selected then we disable the visibilty dropdown and set it to be public.

Conflicts:

	ckan/public/base/javascript/resource.config
@tobes
Copy link
Contributor

tobes commented Jul 16, 2013

Thanks for reporting this bug. The print statement in ckan/ckanext/datastore/plugin.py, line 248 should not be there and apache does not like it. You can delete it.

1 similar comment
@tobes
Copy link
Contributor

tobes commented Jul 16, 2013

Thanks for reporting this bug. The print statement in ckan/ckanext/datastore/plugin.py, line 248 should not be there and apache does not like it. You can delete it.

@tobes
Copy link
Contributor

tobes commented Jul 16, 2013

So I was trying to be clever and branch this off the 2.1 release branch commit a5e601b is all we care about

@domoritz can you cherry pick into master and get into 2.1 :)

@ghost ghost assigned tobes and domoritz Jul 16, 2013
domoritz added a commit that referenced this pull request Jul 16, 2013
@domoritz domoritz mentioned this pull request Jul 16, 2013
@tobes tobes closed this in #1113 Jul 16, 2013
@domoritz
Copy link
Contributor

Done in #1113

@tobes tobes deleted the 1111-fix-datastore branch July 16, 2013 15:29
domoritz added a commit that referenced this pull request Jul 31, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants