CKAN on RedHat

179 views
Skip to first unread message

alansnow21

unread,
Sep 23, 2015, 3:53:20 PM9/23/15
to Tethys Platform
Has anyone tried to install CKAN on RedHat or CentOS in the past? Do you have any documentation for how you did it?

I have looked at:




and am unsure where my issue is. I just get an Internal Server Error.

If you do, please share :)

Thanks!

alansnow21

unread,
Sep 24, 2015, 11:04:05 AM9/24/15
to Tethys Platform

alansnow21

unread,
Sep 25, 2015, 1:03:04 PM9/25/15
to Tethys Platform
Is there a specific version for CKAN that your api was designed around? I am having troubles with one of the more recent versions.

alansnow21

unread,
Sep 25, 2015, 1:04:42 PM9/25/15
to Tethys Platform
Or could it be how you configured the setup?

sdc50

unread,
Sep 28, 2015, 1:58:15 PM9/28/15
to Tethys Platform
Alan,

Have you had any luck with using the CKAN REST api? We just had our CKAN server updated and now the api doesn't seem to be working.

alansnow21

unread,
Sep 28, 2015, 2:04:06 PM9/28/15
to Tethys Platform

Hi Scott,

The solution I found was in the Tethys Platform code. Here is what I did:

If you are using CKAN 2.3 -2.5:

If you see this error when uploading a dataset: The url and file parameters are mutually exclusive: use one, not both.

You may need to go to: /usr/lib/tethys/lib/python2.7/site-packages/tethys_dataset_services/engines/ckan_engine.py and modify this section of code to look like this:

def create_resource(self, dataset_id, url=None, file=None, console=False, **kwargs):
  ...
  #if url and file:
      #raise IOError('The url and file parameters are mutually exclusive: use one, not both.')
  if not url and not file:
      raise IOError('The url or file parameter is required, but do not use both.')

  ...

alansnow21

unread,
Sep 28, 2015, 2:08:51 PM9/28/15
to Tethys Platform
Also, when creating a resource, you need to include the "url" parameter. 
Another issue I had was that I needed to create an organization. Then, when I create a dataset, I had to set owner_org to the organization's name in lower case.

alansnow21

unread,
Sep 28, 2015, 2:09:57 PM9/28/15
to Tethys Platform
Ex. url="" for the resource and owner_org="byu" for the dataset.

alansnow21

unread,
Sep 29, 2015, 10:52:40 AM9/29/15
to Tethys Platform
Also, in the code (/usr/lib/tethys/lib/python2.7/site-packages/tethys_dataset_services/engines/ckan_engine.py) you may need to change this to be:
def create_resource(self, dataset_id, url=None, file=None, console=False, **kwargs):
  ...
  data_dict['url']=""
  if url:
    data_dict['url'] = url
  ...

sdc50

unread,
Sep 30, 2015, 10:32:28 PM9/30/15
to Tethys Platform
Alan,

Thanks for your input and help. After overcoming several other problems I was getting similar issues to what you had. I mad the change to always add the url parameter. It doesn't seem to matter whether or not I set an organization for a dataset (from what I can tell so far). I'm able to successfully add a resource to a newly created dataset, however when I try to add a second I get the following error:

{u'help': u'https://ciwckan.chpc.utah.edu/api/3/action/help_show?name=resource_create', 

u'success': False, 

u'error': {u'message': u'Unable to add package to search index: Solr returned an error: 400 Bad Request - <html><head><title>Apache Tomcat/6.0.24 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 400 - ERROR: [dae94a2e7be04d3088f85a399e6174b4] multiple values encountered for non multiValued field res_extras_model: [, ]</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>ERROR: [dae94a2e7be04d3088f85a399e6174b4] multiple values encountered for non multiValue', u'__type': u'Search Index Error'}}


Have you encountered this? Any suggestions?

alansnow21

unread,
Oct 1, 2015, 8:28:10 AM10/1/15
to Tethys Platform
Hi Scott,

I have not encountered the message you have, but I have some debugging questions for you:

1) What version of Solr are you using? What version of CKAN are you using?

2) When upgrading CKAN did you follow these instructions? http://docs.ckan.org/en/ckan-2.4.0/maintaining/upgrading/upgrade-source.html

3) Are the permissions on your CKAN data folder set to be owned by apache?

sdc50

unread,
Oct 1, 2015, 12:07:02 PM10/1/15
to Tethys Platform
Alan,

This server is very locked down and I hardly have any access. The computing center guys are the ones that upgraded CKAN so I'm not sure what instructions they used. It's CKAN 2.4.2b, but I'm not able to determine the Solr version (at least with the access that I have). The CKAN data folder is owned by a specific user, but by the apache group. I was testing through the web interface and realized that we can't add more than one resource to a dataset there either, so it seems to be a configuration problem and not an api problem. How much do you know about the solr schema file? I wonder if that could be the culprit.

alansnow21

unread,
Oct 1, 2015, 12:43:19 PM10/1/15
to Tethys Platform
Scott,

I am not an expert with the Solr schema file (all I have is in the docs listed earlier in the thread). If you are locked down, then it can be difficult to do a whole lot. My best guesses are that either you need to upgrade Solr, you have a permissions issue, or you missed a step in http://docs.ckan.org/en/ckan-2.4.0/maintaining/upgrading/upgrade-source.html ($ paster search-index rebuild -r --config=/etc/ckan/default/development.ini). Other than that, I would look at the docs for how I set it up and see what you did differently.

Good luck!
Reply all
Reply to author
Forward
0 new messages