[ckan-dev] CKAN "No section: 'formatters'" error

Derek Hohls dhohls at csir.co.za
Thu Jun 9 11:45:00 UTC 2016


Hi Stefan

1. Permissions: All the files in /etc/ckan/default/ had permissions set as root:root  (i.e. the default user inside the container)

2. Apache - the wsgi file (from /etc/ckan/default/apache.wsgi ) contains::

import os
activate_this = os.path.join('/usr/lib/ckan/default/bin/activate_this.py')
execfile(activate_this, dict(__file__=activate_this))

from paste.deploy import loadapp

config_filepath = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'production.ini')
from paste.script.util.logging_config import fileConfig
fileConfig(config_filepath)
application = loadapp('config:%s' % config_filepath)

 
3. Paster - if I did this::

. /usr/lib/ckan/default/bin/activate
cd /usr/lib/ckan/default/src/ckan
paster serve /etc/ckan/default/production.ini

I got::

2016-06-09 11:17:09,501 CRITI [ckan.lib.uploader] Please specify a ckan.storage_path in your config for your uploads
Starting server in PID 527.
serving on 0.0.0.0:5000 view at http://127.0.0.1:5000

I realised that I had no access to this from outside the container; so stopped the container and re-ran with the port mapping set to 5000 - then I could see the default CKAN login page! 

So, I assumed the problem was the communication between CKAN and Apache. I changed the file ownership of 'production.ini' to www-data; and restarted the Apache server. I was then able to access CKAN on port 80 as expected.

Many thanks for all the help with this issue.

I am sure will be back later with more questions on getting my plug-ins configured!

Derek

PS Getting that  "formatters" error certainly does not help solve this issue; I suppose its not possible to surface something more meaningful?


>>> Stefan Oderbolz <stefan.oderbolz at liip.ch> 09/06/16 11:05 AM >>>
Hi Derek,
the file looks fine. So I guess it must be the path to the file and/or missing permissions to read the file. 

Can you successfully run paster commands? Does the page work if you use "paster serve"? Are you using Apache with WSGI, if so check the apache.wsgi file, if it uses to correct path to the config file.

- Stefan


On Wed, Jun 8, 2016 at 4:52 PM, Derek Hohls <dhohls at csir.co.za> wrote:
Hi Stefan

I am not sure its going to help to make *no* changes as  the links to, for example, solr and postgres are not going to work  (also in Dockers) if these settings are not provided.  By minimal, I  meant just the ones appearing in the installation guide. AFAIK, I did  not change anything about formatters.

I will send a copy of the file to your email.

>>> Stefan Oderbolz <stefan.oderbolz at liip.ch> 06/06/16 8:59 AM >>>
Can you get it to work if you make *no* changes at all? Or what exactly are your "minimum" changes?Somehow there is a problem with the file and it's hard to tell without access to the whole file.


On Fri, Jun 3, 2016 at 4:11 PM, Derek Hohls <dhohls at csir.co.za> wrote:
Thanks Stefan

I am using the default production.ini file supplied with the software and attempting to make the "minimum"  changes to it, in order for CKAN to work.

The sections you asked about are:

[app:main]
use = egg:ckan
full_stack = true
cache_dir = /tmp/%(ckan.site_id)s/
beaker.session.key = ckan

[formatters]
keys = generic

I cannot see any reference to "formatters" in the http://docs.ckan.org/en/latest/maintaining/configuration.html#ckan-configuration-file document?

Thanks
Derek



>>> Stefan Oderbolz <stefan.oderbolz at liip.ch> 02/06/16 9:38 PM >>>
Check the sections in your config file (/etc/ckan/default/production.ini). Is there a [app:main] section? Is there a [formatters] section?Did you generate the config file? If so how? Or what is your template?



You can read more about the config file and its structure here: http://docs.ckan.org/en/latest/maintaining/configuration.html#ckan-configuration-file

If nothing helps, you can try to re-generate the configuration using the following paster command:

paster make-config ckan /etc/ckan/default/new-production.ini



On Tue, May 31, 2016 at 5:02 PM, Derek Hohls <dhohls at csir.co.za> wrote:
I have CKAN installed in a container.

When trying to reach the CKAN webpage, I am getting this error in the ckan_default.error.log::
 Traceback (most recent call last):
   File "/etc/ckan/default/apache.wsgi", line 9, in <module>
     fileConfig(config_filepath)
   File "/usr/lib/ckan/default/lib/python2.7/site-packages/paste/script/util/logging_config.py", line 93, in fileConfig
     formatters = _create_formatters(cp)
   File "/usr/lib/ckan/default/lib/python2.7/site-packages/paste/script/util/logging_config.py", line 125, in _create_formatters
     flist = cp.get("formatters", "keys")
   File "/usr/lib/python2.7/ConfigParser.py", line 330, in get
     raise NoSectionError(section)
 NoSectionError: No section: 'formatters'

The ckan.docs website says this is a common error::

    NoSectionError: No section: 'formatters'

    This suggests that the config file specified with the paster --config 
    parameter (e.g. myconfig.ini) is incorrectly formatted. This may be true, 
    but this error is also printed if you specify an incorrect filename for 
    the config file!

I checked in the section of code where the error is raised.  It seems as if the file it is looking for is stored in the 'fname' variable.  Echoing the contents of this variable shows its value to be `/etc/ckan/default/production.ini` (which is what I would expect).  This implies the file itself is incorrectly formatted.  How do I go about finding what is incorrect about the formatting & then fixing it?

Thanks
Derek

 
--  
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.  
This message has been scanned for viruses and dangerous content by MailScanner,  
and is believed to be clean. 
 
Please consider the environment before printing this email. 

 
 
_______________________________________________
 ckan-dev mailing list
 ckan-dev at lists.okfn.org
 https://lists.okfn.org/mailman/listinfo/ckan-dev
 Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
 




-- 
Liip AG  // Limmatstrasse 183 //  CH-8005 Zürich
Tel +41 43 500 39 80 // GnuPG 0x7B588C67 // www.liip.ch


 
  
--  
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.  
This message has been scanned for viruses and dangerous content by MailScanner,  
and is believed to be clean. 
 
Please consider the environment before printing this email. 
 


 
--  
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.  
This message has been scanned for viruses and dangerous content by MailScanner,  
and is believed to be clean. 
 
Please consider the environment before printing this email. 

 


 



-- 
Liip AG  // Limmatstrasse 183 //  CH-8005 Zürich
Tel +41 43 500 39 80 // GnuPG 0x7B588C67 // www.liip.ch


 
  
--  
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.  
This message has been scanned for viruses and dangerous content by MailScanner,  
and is believed to be clean. 
 
Please consider the environment before printing this email. 
 


 
--  
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.  
This message has been scanned for viruses and dangerous content by MailScanner,  
and is believed to be clean. 
 
Please consider the environment before printing this email. 

 


 



-- 
Liip AG  // Limmatstrasse 183 //  CH-8005 Zürich
Tel +41 43 500 39 80 // GnuPG 0x7B588C67 // www.liip.ch


 
 


-- 
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.

This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.

Please consider the environment before printing this email.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20160609/2af4e982/attachment-0003.html>


More information about the ckan-dev mailing list