[ckan-dev] [ckan-discuss] Some problems installing ckan

Ross Jones ross.jones at okfn.org
Mon Feb 27 13:31:51 UTC 2012


Hi Rubén,

The problem is one with versioning of pairtree I think.  You will need to let pairtree know that the folder you have chosen is actually a repository.  The README on ckanext-storage *should* mention this but I can't access it at the moment as github seems to be down again (at least for me).

If you create a file called pairtree_version0_1 in the folder you have chosen as your storage_dir then it should resolve the problem. The file should be empty.

Regards

Ross.




On 27 Feb 2012, at 12:28, Ruben Martin wrote:

> Moving this thread from the ckan-discuss list.
> 
> Rufus, you were right, i was reading some pages of manual for version 1.6.
> 
> Anyway, i have completed a clean installations of ckan 1.5.1 following
> instructions in:
> http://readthedocs.org/docs/ckan/en/ckan-1.5.1/install-from-source.html
> with: pip install --ignore-installed -e
> git+https://github.com/okfn/ckan.git@ckan-1.5.1#egg=ckan
> 
> Finished default installation, i install ckanext-storage as explained
> in http://packages.python.org/ckanext-storage/
> 
> And the problem remains the same after i: message "Failed to get
> credentials for storage upload. Upload cannot proceed" when i select a
> file, and when i click on the button, the icon keeps spinning.
> 
> There must be some bad configuration with pairtree because when a i
> visit: http://127.0.0.1:5000/api/storage/auth/form/xyz
> ckan log show this error:
> 
> Error - <class 'pairtree.storage_exceptions.NotAPairtreeStoreException'>:
> URL: http://127.0.0.1:5000/api/storage/auth/form/xyz
> File '/usr/lib/pymodules/python2.6/weberror/errormiddleware.py', line
> 162 in __call__
>  app_iter = self.application(environ, sr_checker)
> File '/usr/lib/pymodules/python2.6/beaker/middleware.py', line 73 in __call__
>  return self.app(environ, start_response)
> File '/usr/lib/pymodules/python2.6/beaker/middleware.py', line 152 in __call__
>  return self.wrap_app(environ, session_start_response)
> File '/usr/lib/pymodules/python2.6/routes/middleware.py', line 130 in __call__
>  response = self.app(environ, start_response)
> File '/usr/lib/pymodules/python2.6/pylons/wsgiapp.py', line 125 in __call__
>  response = self.dispatch(controller, environ, start_response)
> File '/usr/lib/pymodules/python2.6/pylons/wsgiapp.py', line 324 in dispatch
>  return controller(environ, start_response)
> File '/home/ruben/pyenv/src/ckan/ckan/lib/base.py', line 123 in __call__
>  return WSGIController.__call__(self, environ, start_response)
> File '/usr/lib/pymodules/python2.6/pylons/controllers/core.py', line
> 221 in __call__
>  response = self._dispatch_call()
> File '/usr/lib/pymodules/python2.6/pylons/controllers/core.py', line
> 172 in _dispatch_call
>  response = self._inspect_call(func)
> File '/usr/lib/pymodules/python2.6/pylons/controllers/core.py', line
> 107 in _inspect_call
>  result = self._perform_call(func, args)
> File '/usr/lib/pymodules/python2.6/pylons/controllers/core.py', line
> 60 in _perform_call
>  return func(**args)
> File '<string>', line 2 in auth_form
> File '/home/ruben/pyenv/src/ckan/ckan/lib/jsonp.py', line 26 in jsonpify
>  data = func(*args, **kwargs)
> File '/home/ruben/pyenv/lib/python2.6/site-packages/ckanext/storage/controller.py',
> line 301 in auth_form
>  authorize(method, bucket, label, c.userobj, self.ofs)
> File '/home/ruben/pyenv/lib/python2.6/site-packages/ckanext/storage/controller.py',
> line 92 in ofs
>  return get_ofs()
> File '/home/ruben/pyenv/lib/python2.6/site-packages/ckanext/storage/controller.py',
> line 71 in get_ofs
>  ofs = get_impl(storage_backend)(**kw)
> File '/home/ruben/pyenv/lib/python2.6/site-packages/ofs/local/pairtreestore.py',
> line 30 in __init__
>  self._open_store()
> File '/home/ruben/pyenv/lib/python2.6/site-packages/ofs/local/pairtreestore.py',
> line 34 in _open_store
>  self._store = PairtreeStorageClient(self.uri_base, self.storage_dir,
> shorty_length=self.shorty_length, hashing_type=self.hashing_type)
> File '/home/ruben/pyenv/lib/python2.6/site-packages/pairtree/pairtree_client.py',
> line 91 in __init__
>  self._init_store()
> File '/home/ruben/pyenv/lib/python2.6/site-packages/pairtree/pairtree_client.py',
> line 264 in _init_store
>  raise NotAPairtreeStoreException
> NotAPairtreeStoreException:
> 
> 
> CGI Variables
> -------------
>  AUTH_TYPE: 'cookie'
>  CONTENT_LENGTH: '0'
>  CONTENT_TYPE: '; charset="utf-8"'
>  HTTP_ACCEPT: 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'
>  HTTP_ACCEPT_ENCODING: 'gzip, deflate'
>  HTTP_ACCEPT_LANGUAGE: 'en-us,en;q=0.5'
>  HTTP_CONNECTION: 'keep-alive'
>  HTTP_COOKIE: 'ckan=596d09d656d3bb4ac0a79383c739051c6a70ec0b6af2b213edbb6b86986932af03a53bfd;
> auth_tkt="92d0f333d415d7dd791fe98d32127df14f4b6f6eadmin!userid_type:unicode";
> ckan_user=admin; ckan_display_name=admin;
> ckan_apikey=c89c44d0-4421-4857-a75f-6f20e614a763;
> hide_welcome_message=1'
>  HTTP_HOST: '127.0.0.1:5000'
>  HTTP_USER_AGENT: 'Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:10.0.2)
> Gecko/20100101 Firefox/10.0.2'
>  PATH_INFO: '/api/storage/auth/form/xyz'
>  REMOTE_ADDR: '127.0.0.1'
>  REMOTE_USER: u'admin'
>  REMOTE_USER_DATA: 'userid_type:unicode'
>  REMOTE_USER_TOKENS: ['']
>  REQUEST_METHOD: 'GET'
>  SERVER_NAME: '0.0.0.0'
>  SERVER_PORT: '5000'
>  SERVER_PROTOCOL: 'HTTP/1.1'
> 
> 
> WSGI Variables
> --------------
>  application: <beaker.middleware.CacheMiddleware object at 0x9c5db6c>
>  beaker.cache: <beaker.cache.CacheManager object at 0x9c5db4c>
>  beaker.get_session: <bound method SessionMiddleware._get_session of
> <beaker.middleware.SessionMiddleware object at 0x9c5dacc>>
>  beaker.session: {'_accessed_time': 1330344436.3058109,
> '_creation_time': 1330341651.995723}
>  paste.cookies: (<SimpleCookie:
> auth_tkt='92d0f333d415d7dd791fe98d32127df14f4b6f6eadmin!userid_type:unicode'
> ckan='596d09d656d3bb4ac0a79383c739051c6a70ec0b6af2b213edbb6b86986932af03a53bfd'
> ckan_apikey='c89c44d0-4421-4857-a75f-6f20e614a763'
> ckan_display_name='admin' ckan_user='admin' hide_welcome_message='1'>,
> 'ckan=596d09d656d3bb4ac0a79383c739051c6a70ec0b6af2b213edbb6b86986932af03a53bfd;
> auth_tkt="92d0f333d415d7dd791fe98d32127df14f4b6f6eadmin!userid_type:unicode";
> ckan_user=admin; ckan_display_name=admin;
> ckan_apikey=c89c44d0-4421-4857-a75f-6f20e614a763;
> hide_welcome_message=1')
>  paste.httpserver.thread_pool: <paste.httpserver.ThreadPool object at
> 0xb757fdac>
>  paste.registry: <paste.registry.Registry object at 0x9e09f0c>
>  paste.throw_errors: True
>  pylons.action_method: <bound method StorageAPIController.auth_form
> of <ckanext.storage.controller.StorageAPIController object at
> 0x9daa7cc>>
>  pylons.controller: <ckanext.storage.controller.StorageAPIController
> object at 0x9daa7cc>
>  pylons.environ_config: {'session': 'beaker.session', 'cache': 'beaker.cache'}
>  pylons.pylons: <pylons.util.PylonsContext object at 0x9db894c>
>  pylons.routes_dict: {'action': u'auth_form', 'controller':
> u'ckanext.storage.controller:StorageAPIController', 'label': u'xyz'}
>  repoze.who.identity: <repoze.who identity (hidden, dict-like) at 164613836>
>  repoze.who.logger: <logging.Logger instance at 0x9c5de0c>
>  repoze.who.plugins: {'openid': <OpenIdIdentificationPlugin
> 164756684>, 'friendlyform': <FriendlyFormPlugin 163962476>,
> 'ckan.lib.authenticator:UsernamePasswordAuthenticator':
> <ckan.lib.authenticator.UsernamePasswordAuthenticator object at
> 0x9d25e8c>, 'auth_tkt': <AuthTktCookiePlugin 164780332>,
> 'ckan.lib.authenticator:OpenIDAuthenticator':
> <ckan.lib.authenticator.OpenIDAuthenticator object at 0x9d25e2c>}
>  routes.route: <routes.route.Route object at 0x9b4886c>
>  routes.url: <routes.util.URLGenerator object at 0x9db8a8c>
>  webob._parsed_query_vars: (GET([]), '')
>  webob.adhoc_attrs: {'language': 'en-us'}
>  wsgi process: 'Multithreaded'
>  wsgiorg.routing_args: (<routes.util.URLGenerator object at
> 0x9db8a8c>, {'action': u'auth_form', 'controller':
> u'ckanext.storage.controller:StorageAPIController', 'label': u'xyz'})
> ------------------------------------------------------------
> 
>            <p>Additionally an error occurred while sending the
> <weberror.reporter.EmailReporter object at 0x9daa14c> report:
> 
>            <pre>Traceback (most recent call last):
>  File "/usr/lib/pymodules/python2.6/weberror/errormiddleware.py",
> line 450, in send_report
>    rep.report(exc_data)
>  File "/usr/lib/pymodules/python2.6/weberror/reporter.py", line 45, in report
>    server = smtplib.SMTP(self.smtp_server)
>  File "/usr/lib/python2.6/smtplib.py", line 239, in __init__
>    (code, msg) = self.connect(host, port)
>  File "/usr/lib/python2.6/smtplib.py", line 295, in connect
>    self.sock = self._get_socket(host, port, self.timeout)
>  File "/usr/lib/python2.6/smtplib.py", line 273, in _get_socket
>    return socket.create_connection((port, host), timeout)
>  File "/usr/lib/python2.6/socket.py", line 514, in create_connection
>    raise error, msg
> error: [Errno 111] Connection refused
> </pre>
>            </p>
> 
> Now, im in #ckan on freenode as rubenmartinctic
> 
> 
> 2012/2/22 Rufus Pollock <rufus.pollock at okfn.org>
>> 
>> On 22 February 2012 15:27, Ruben Martin <ruben.martin at fundacionctic.org> wrote:
>>> Thanks for the response Rufus
>> 
>> Should we move this to the ckan-dev list? Also if you are able to drop
>> into IRC (#ckan on freenode) we can probably debug this very quickly
>> :-)
>> 
>>> We followed the current package installation instructions in the web manual,
>>> so version is 1.5.1 (and so appears below in the footer of the pages)
>> 
>> Can you point me to exact url of docs you read. I would point that
>> default manual at http://docs.ckan.org/ is for v1.6! (not v1.5.1 - for
>> v1.5.1 you need http://docs.ckan.org/en/ckan-1.5.1/index.html). I note
>> that for v1.5.1 you need to install ckanext-storage which I assume you
>> have.
>> 
>>> Yes, I am logged in when i try to upload a file. But after the selection of
>>> a file and before i click on the Add button, this message appears:
>>> "Failed to get credentials for storage upload. Upload cannot proceed"
>>> Maybe it is trying to connect with Webstore ?
>> 
>> This won't be to do with Webstore. What happens if you visit:
>> 
>> http://{your-ckan-instance}/api/storage/auth/form/xyz
>> 
>> That's the API the upload stuff calls to get permission and
>> credentials for upload.
>> 
>> Rufus
> 
> 
> 
> 
> --
> 
> Rubén Martín Calderero
> 
> CTIC-Centro Tecnológico
> Parque Científico y Tecnológico de Gijón
> c/ Ada Byron, 39 Edificio Centros Tecnológicos
> 33203 Gijón - Asturias - España
> Tel.: +34 984 29 12 12
> Fax: +34 984 39 06 12
> E-mail: ruben.martin at fundacionctic.org
> http://www.fundacionctic.org
> Política de Privacidad: http://www.fundacionctic.org/privacidad
> 
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20120227/cee31297/attachment-0001.html>


More information about the ckan-dev mailing list