[ckan-pt] Instalação do Basiccharts

Vitor Baptista vitor vitorbaptista.com
Quarta-Feira, 14 de Maio de 2014 - 19:05:24 UTC


Oi pessoal,

Essa é uma parte bem confusa mesmo. Não trabalhei diretamente com eles,
então não consigo explicar com mais detalhes mas, resumindo, o DataStore é
o sistema que gera a API com os resources do CKAN. Porém, para os resources
serem carregados nele (e terem uma API), precisávamos de outro sistema.

No CKAN 2.0, esse sistema era o
DataStorer<https://github.com/ckan/ckanext-datastorer>.
Porem tivemos muitos problemas com ele, e a partir do CKAN 2.1 fizemos o
DataPusher <https://github.com/ckan/datapusher>. Ele é o que deve ser usado
agora.

Abraços,


Em 13 de maio de 2014 09:41, Marconi Clementino <marconix16  gmail.com>escreveu:

> O site de Recife está com o ckan 2.0 e datastorer.
>
> Na documentação do 2.0 ele recomendava o datastorer.  O datapusher estou
> conhecendo por aqui.
> Em 13/05/2014 08:12, "Carlos Augusto" <carlosmarcosaugusto  gmail.com>
> escreveu:
>
>  Dúvida minha também: DataPusher ou Datastorer?
>>
>>
>>
>> Em 13 de maio de 2014 05:34, Andres MRM <andres  inventati.org> escreveu:
>>
>>> O Datastorer não é o para versões mais antigas do CKAN?
>>>
>>> E isso tudo é estranho, instalei o CKAN há alguns dias atrás e não tive
>>> problemas. Mas era o branch principal, não esse das views, e era em um
>>> Postgres na porta padrão. Por isso é que acho que uma dessas coisas que
>>> está causando os problemas.
>>>
>>>
>>> On 13-05-14 00:35, Marconi Clementino wrote:
>>>
>>>> Eu utilizo o datastoreR
>>>>
>>>>
>>>> 2014-05-12 22:02 GMT-03:00 Andres MRM <andres  inventati.org>:
>>>>
>>>>  Mais um problema talvez relacionado...
>>>>> Instalei o DataPusher segundo as instruções aqui:
>>>>> http://docs.ckan.org/projects/datapusher/en/latest/
>>>>>
>>>>> Mais estou tendo esse erro quando tento dar um push nos dados pelo
>>>>> painel no site:
>>>>> OperationalError: (OperationalError) no such table: apscheduler_jobs
>>>>> u'DELETE FROM apscheduler_jobs WHERE apscheduler_jobs.id = ?' (7,)
>>>>>
>>>>> Conectando à database datastore_default vai psql, dei um \dt e ele me
>>>>> disse que não há tabelas, não parece bom...
>>>>>
>>>>>
>>>>>
>>>>> On 12-05-14 21:34, Andres MRM wrote:
>>>>>
>>>>>  As duas últimas linhas resolveram, obrigado.
>>>>>> Estranho, será que é algum problema na configuração do paster?
>>>>>>
>>>>>> On 12-05-14 16:54, Marconi Clementino wrote:
>>>>>>
>>>>>>  A view:
>>>>>>>
>>>>>>> GRANT ALL ON TABLE _table_metadata TO us_ckan; *-- Usuário CKAN*
>>>>>>> GRANT SELECT ON TABLE _table_metadata TO us_ckan_data_select; *---
>>>>>>> Usuário
>>>>>>> ReadOnly*
>>>>>>>
>>>>>>>
>>>>>>> Rode estes comandos diretamente que passa.
>>>>>>>
>>>>>>>
>>>>>>> 2014-05-12 16:53 GMT-03:00 Marconi Clementino <marconix16  gmail.com
>>>>>>> >:
>>>>>>>
>>>>>>>  Como fica nosso banco datastore :
>>>>>>>
>>>>>>>>
>>>>>>>> DATASTORE:
>>>>>>>>
>>>>>>>> GRANT CONNECT, TEMPORARY ON DATABASE dbpockan_data_storage_utf8 TO
>>>>>>>> public;
>>>>>>>> GRANT ALL ON DATABASE dbpockan_data_storage_utf8 TO us_ckan;  ---
>>>>>>>> *Usuario
>>>>>>>> CKAN*
>>>>>>>> GRANT CONNECT ON DATABASE dbpockan_data_storage_utf8 TO
>>>>>>>> us_ckan_data_select; ---- *Usuario ReadOnly*
>>>>>>>> GRANT ALL ON SCHEMA public TO us_ckan;
>>>>>>>> GRANT USAGE ON SCHEMA public TO us_ckan_data_select;
>>>>>>>> ALTER DEFAULT PRIVILEGES IN SCHEMA public
>>>>>>>>    GRANT SELECT ON TABLES
>>>>>>>>    TO us_ckan_data_select; *--- Usuario ReadOnly*
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> 2014-05-12 16:46 GMT-03:00 Andres MRM <andres  inventati.org>:
>>>>>>>>
>>>>>>>> 9.3
>>>>>>>>
>>>>>>>>
>>>>>>>>>
>>>>>>>>> On 12-05-14 16:44, Marconi Clementino wrote:
>>>>>>>>>
>>>>>>>>>  Qual a versão do postgresql?
>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> 2014-05-12 16:41 GMT-03:00 Andres MRM <andres  inventati.org>:
>>>>>>>>>>
>>>>>>>>>> Obrigado, Marconi. Tentei com o set_permissions, mas agora está me
>>>>>>>>>> dando
>>>>>>>>>>
>>>>>>>>>>  outro erro:
>>>>>>>>>>>
>>>>>>>>>>> ProgrammingError: (ProgrammingError) ERRO:  permissão negada para
>>>>>>>>>>> relação
>>>>>>>>>>> _table_metadata
>>>>>>>>>>>
>>>>>>>>>>> Será que configurei o script errado? Deixei assim:
>>>>>>>>>>> -- name of the main CKAN database
>>>>>>>>>>> \set maindb "ckan_default"
>>>>>>>>>>> -- the name of the datastore database
>>>>>>>>>>> \set datastoredb "datastore_default"
>>>>>>>>>>> -- username of the ckan postgres user
>>>>>>>>>>> \set ckanuser "ckan_default"
>>>>>>>>>>> -- username of the datastore user that can write
>>>>>>>>>>> \set wuser "ckan_default"
>>>>>>>>>>> -- username of the datastore user who has only read permissions
>>>>>>>>>>> \set rouser "datastore_default"
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On 12-05-14 15:53, Marconi Clementino wrote:
>>>>>>>>>>>
>>>>>>>>>>> Andres, se o erro persistir, você pode editar o arquivo
>>>>>>>>>>>
>>>>>>>>>>>  set_permissions.sql
>>>>>>>>>>>> e rodar diretamente no banco.
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> 2014-05-12 15:38 GMT-03:00 Andres MRM <andres  inventati.org>:
>>>>>>>>>>>>
>>>>>>>>>>>> Você tem razão, este comando:
>>>>>>>>>>>>
>>>>>>>>>>>>  paster datastore set-permissions postgres -c
>>>>>>>>>>>>
>>>>>>>>>>>>> /etc/ckan/default/development.
>>>>>>>>>>>>> ini
>>>>>>>>>>>>> Está me dando este erro:
>>>>>>>>>>>>> An error occured: psql: FATAL:  database "datastore_default"
>>>>>>>>>>>>> does
>>>>>>>>>>>>> not
>>>>>>>>>>>>> exist
>>>>>>>>>>>>>
>>>>>>>>>>>>> Mas rodando:
>>>>>>>>>>>>> sudo -u postgres psql -l -p 5433
>>>>>>>>>>>>> A base está la:
>>>>>>>>>>>>> ckan_default      | ckan_default | UTF8        | pt_BR.utf8 |
>>>>>>>>>>>>> pt_BR.utf8
>>>>>>>>>>>>> |
>>>>>>>>>>>>> datastore_default | ckan_default | UTF8        | pt_BR.utf8 |
>>>>>>>>>>>>> pt_BR.utf8
>>>>>>>>>>>>> |
>>>>>>>>>>>>> Será que o paster está tentando alterar as permissões no
>>>>>>>>>>>>> Postgres
>>>>>>>>>>>>> em
>>>>>>>>>>>>> 5432 e
>>>>>>>>>>>>> não em 5433 como está configurado no development.ini?
>>>>>>>>>>>>> Ele soube criá-las corretamente na instalação do CKAN...
>>>>>>>>>>>>>
>>>>>>>>>>>>> A configuração está assim:
>>>>>>>>>>>>> sqlalchemy.url = postgresql://ckan_default:SENHA@localhost
>>>>>>>>>>>>> :5433/ckan_
>>>>>>>>>>>>> default
>>>>>>>>>>>>> ckan.datastore.write_url = postgresql://ckan_default:
>>>>>>>>>>>>> SENHA  localhost
>>>>>>>>>>>>> :5433/
>>>>>>>>>>>>> datastore_default
>>>>>>>>>>>>> ckan.datastore.read_url = postgresql://datastore_
>>>>>>>>>>>>> default:SENHAA  localhost
>>>>>>>>>>>>> :5433/datastore_default
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> On 12-05-14 13:00, Vitor Baptista wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>> Oi Andres,
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>  Isso me parece um problema na sua instalação do DataStore.
>>>>>>>>>>>>>> Mais
>>>>>>>>>>>>>> especificamente, na parte de configurar as permissões em
>>>>>>>>>>>>>> http://docs.ckan.org/en/latest/maintaining/datastore.html .
>>>>>>>>>>>>>> Veja
>>>>>>>>>>>>>>>>>>>>>>>>>>>> a
>>>>>>>>>>>>>> documentação e cheque se está tudo certo.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Abraços,
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> 2014-05-09 22:05 GMT-03:00 Andres MRM <andres  inventati.org>:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Opa! Agora consegui adicionar os plugins e iniciar o site. Mas
>>>>>>>>>>>>>> quando
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> vou tentar adicionar alguma base para testar, estou tendo esse
>>>>>>>>>>>>>> erro:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> 2014-05-09 22:02:35,550 ERROR [ckan.model.modification]
>>>>>>>>>>>>>>> (ProgrammingError)
>>>>>>>>>>>>>>> ERRO:  permissão negada para relação _table_metadata
>>>>>>>>>>>>>>> 'SELECT 1 FROM "_table_metadata" WHERE name = %s AND
>>>>>>>>>>>>>>> alias_of IS
>>>>>>>>>>>>>>> NULL'
>>>>>>>>>>>>>>> (u'971d3b53-b5c5-4da5-94db-7e3ada438cd5',)
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Traceback (most recent call last):
>>>>>>>>>>>>>>> File "/home/andres/ckan/lib/default/src/ckan/ckan/model/
>>>>>>>>>>>>>>> modification.py",
>>>>>>>>>>>>>>> line 79, in notify
>>>>>>>>>>>>>>>   observer.notify(entity, operation)
>>>>>>>>>>>>>>> File "/home/andres/ckan/lib/default/src/ckan/ckan/lib/
>>>>>>>>>>>>>>> search/__init__.py",
>>>>>>>>>>>>>>> line 128, in notify
>>>>>>>>>>>>>>>   {'id': entity.id}),
>>>>>>>>>>>>>>> File "/home/andres/ckan/lib/default/src/ckan/ckan/logic/__
>>>>>>>>>>>>>>> init__.py",
>>>>>>>>>>>>>>> line 414, in wrapped
>>>>>>>>>>>>>>>   result = _action(context, data_dict, **kw)
>>>>>>>>>>>>>>> File "/home/andres/ckan/lib/default/src/ckan/ckan/logic/
>>>>>>>>>>>>>>> action/get.py",
>>>>>>>>>>>>>>> line 901, in package_show
>>>>>>>>>>>>>>>   resource_dict = item.before_show(resource_dict)
>>>>>>>>>>>>>>> File "/home/andres/ckan/lib/default/src/ckan/ckanext/
>>>>>>>>>>>>>>> datastore/plugin.py",
>>>>>>>>>>>>>>> line 244, in before_show
>>>>>>>>>>>>>>>   resource_dict['id']
>>>>>>>>>>>>>>> File "/usr/lib/ckan/default/local/
>>>>>>>>>>>>>>> lib/python2.7/site-packages/
>>>>>>>>>>>>>>> sqlalchemy/engine/base.py",
>>>>>>>>>>>>>>> line 1449, in execute
>>>>>>>>>>>>>>>   params)
>>>>>>>>>>>>>>> File "/usr/lib/ckan/default/local/
>>>>>>>>>>>>>>> lib/python2.7/site-packages/
>>>>>>>>>>>>>>> sqlalchemy/engine/base.py",
>>>>>>>>>>>>>>> line 1628, in _execute_text
>>>>>>>>>>>>>>>   statement, parameters
>>>>>>>>>>>>>>> File "/usr/lib/ckan/default/local/
>>>>>>>>>>>>>>> lib/python2.7/site-packages/
>>>>>>>>>>>>>>> sqlalchemy/engine/base.py",
>>>>>>>>>>>>>>> line 1698, in _execute_context
>>>>>>>>>>>>>>>   context)
>>>>>>>>>>>>>>> File "/usr/lib/ckan/default/local/
>>>>>>>>>>>>>>> lib/python2.7/site-packages/
>>>>>>>>>>>>>>> sqlalchemy/engine/base.py",
>>>>>>>>>>>>>>> line 1691, in _execute_context
>>>>>>>>>>>>>>>   context)
>>>>>>>>>>>>>>> File "/usr/lib/ckan/default/local/
>>>>>>>>>>>>>>> lib/python2.7/site-packages/
>>>>>>>>>>>>>>> sqlalchemy/engine/default.py",
>>>>>>>>>>>>>>> line 331, in do_execute
>>>>>>>>>>>>>>>   cursor.execute(statement, parameters)
>>>>>>>>>>>>>>> ProgrammingError: (ProgrammingError) ERRO:  permissão negada
>>>>>>>>>>>>>>> para
>>>>>>>>>>>>>>> relação
>>>>>>>>>>>>>>> _table_metadata
>>>>>>>>>>>>>>> 'SELECT 1 FROM "_table_metadata" WHERE name = %s AND
>>>>>>>>>>>>>>> alias_of IS
>>>>>>>>>>>>>>> NULL'
>>>>>>>>>>>>>>> (u'971d3b53-b5c5-4da5-94db-7e3ada438cd5',)
>>>>>>>>>>>>>>> Error - <class 'sqlalchemy.exc.ProgrammingError'>:
>>>>>>>>>>>>>>> (ProgrammingError)
>>>>>>>>>>>>>>> ERRO:  permissão negada para relação _table_metadata
>>>>>>>>>>>>>>> 'SELECT 1 FROM "_table_metadata" WHERE name = %s AND
>>>>>>>>>>>>>>> alias_of IS
>>>>>>>>>>>>>>> NULL'
>>>>>>>>>>>>>>> (u'971d3b53-b5c5-4da5-94db-7e3ada438cd5',)
>>>>>>>>>>>>>>> 2014-05-09 22:02:35,889 INFO  [ckan.lib.base]
>>>>>>>>>>>>>>> /dataset/new_resource/ctdtdc render time 0.152 seconds
>>>>>>>>>>>>>>> 2014-05-09 22:02:36,255 INFO  [ckan.lib.base]  /api/i18n/en
>>>>>>>>>>>>>>> render
>>>>>>>>>>>>>>> time
>>>>>>>>>>>>>>> 0.003 seconds
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Tentei recriar o BD, mas ele persiste...
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>>> ckan-pt mailing list
>>>>>>>>>>>>>>> ckan-pt  lists.okfn.org
>>>>>>>>>>>>>>> https://lists.okfn.org/mailman/listinfo/ckan-pt
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>  --
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Vítor Baptista
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Developer  |  http://vitorbaptista.com |
>>>>>>>>>>>>>> LinkedIn<http://www.linkedin.com/in/vitorbaptista>|
>>>>>>>>>>>>>> @vitorbaptista <http://twitter.com/vitorbaptista>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> The Open Knowledge Foundation <http://okfn.org>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> *Empowering through Open Knowledge*
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> http://okfn.org/  |  @okfn <http://twitter.com/okfn>  |  OKF
>>>>>>>>>>>>>> on
>>>>>>>>>>>>>> Facebook<https://www.facebook.com/OKFNetwork> |
>>>>>>>>>>>>>> Blog <http://blog.okfn.org/>  |  Newsletter<http://okfn.org/
>>>>>>>>>>>>>> about/newsletter/>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>  _______________________________________________
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>> ckan-pt mailing list
>>>>>>>>>>>>>
>>>>>>>>>>>>>  ckan-pt  lists.okfn.org
>>>>>>>>>>>>>> https://lists.okfn.org/mailman/listinfo/ckan-pt
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>  ckan-pt mailing list
>>>>>>>>>>>>> ckan-pt  lists.okfn.org
>>>>>>>>>>>>> https://lists.okfn.org/mailman/listinfo/ckan-pt
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>  --
>>>>>>>>>>>> Atenciosamente,
>>>>>>>>>>>>
>>>>>>>>>>>> Marconi Clementino de Oliveira
>>>>>>>>>>>> Analista de Sistemas - DSI - EMPREL
>>>>>>>>>>>> Celular: +55 81 8719-1703
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>  _______________________________________________
>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>  ckan-pt mailing list
>>>>>>>>>>>
>>>>>>>>>>>> ckan-pt  lists.okfn.org
>>>>>>>>>>>> https://lists.okfn.org/mailman/listinfo/ckan-pt
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>  _______________________________________________
>>>>>>>>>>>>
>>>>>>>>>>> ckan-pt mailing list
>>>>>>>>>>> ckan-pt  lists.okfn.org
>>>>>>>>>>> https://lists.okfn.org/mailman/listinfo/ckan-pt
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> Atenciosamente,
>>>>>>>>>>
>>>>>>>>>> Marconi Clementino de Oliveira
>>>>>>>>>> Analista de Sistemas - DSI - EMPREL
>>>>>>>>>> Celular: +55 81 8719-1703
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>  _______________________________________________
>>>>>>>>>
>>>>>>>>>  ckan-pt mailing list
>>>>>>>>>> ckan-pt  lists.okfn.org
>>>>>>>>>> https://lists.okfn.org/mailman/listinfo/ckan-pt
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>  _______________________________________________
>>>>>>>>> ckan-pt mailing list
>>>>>>>>> ckan-pt  lists.okfn.org
>>>>>>>>> https://lists.okfn.org/mailman/listinfo/ckan-pt
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> Atenciosamente,
>>>>>>>>
>>>>>>>> Marconi Clementino de Oliveira
>>>>>>>> Analista de Sistemas - DSI - EMPREL
>>>>>>>> Celular: +55 81 8719-1703
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Atenciosamente,
>>>>>>>
>>>>>>> Marconi Clementino de Oliveira
>>>>>>> Analista de Sistemas - DSI - EMPREL
>>>>>>> Celular: +55 81 8719-1703
>>>>>>>
>>>>>>>
>>>>>>  _______________________________________________
>>>>>>
>>>>>>> ckan-pt mailing list
>>>>>>> ckan-pt  lists.okfn.org
>>>>>>> https://lists.okfn.org/mailman/listinfo/ckan-pt
>>>>>>>
>>>>>>>
>>>>>> _______________________________________________
>>>>>> ckan-pt mailing list
>>>>>> ckan-pt  lists.okfn.org
>>>>>> https://lists.okfn.org/mailman/listinfo/ckan-pt
>>>>>>
>>>>>>  _______________________________________________
>>>>> ckan-pt mailing list
>>>>> ckan-pt  lists.okfn.org
>>>>> https://lists.okfn.org/mailman/listinfo/ckan-pt
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Atenciosamente,
>>>>
>>>> Marconi Clementino de Oliveira
>>>> Analista de Sistemas - DSI - EMPREL
>>>> Celular: +55 81 8719-1703
>>>>
>>>
>>>  _______________________________________________
>>>> ckan-pt mailing list
>>>> ckan-pt  lists.okfn.org
>>>> https://lists.okfn.org/mailman/listinfo/ckan-pt
>>>>
>>>
>>> _______________________________________________
>>> ckan-pt mailing list
>>> ckan-pt  lists.okfn.org
>>> https://lists.okfn.org/mailman/listinfo/ckan-pt
>>>
>>
>>
>> _______________________________________________
>> ckan-pt mailing list
>> ckan-pt  lists.okfn.org
>> https://lists.okfn.org/mailman/listinfo/ckan-pt
>>
>>
> _______________________________________________
> ckan-pt mailing list
> ckan-pt  lists.okfn.org
> https://lists.okfn.org/mailman/listinfo/ckan-pt
>
>


-- 

Vítor Baptista

Developer  |  http://vitorbaptista.com |
LinkedIn<http://www.linkedin.com/in/vitorbaptista>|
@vitorbaptista <http://twitter.com/vitorbaptista>

The Open Knowledge Foundation <http://okfn.org>

*Empowering through Open Knowledge*

http://okfn.org/  |  @okfn <http://twitter.com/okfn>  |  OKF on
Facebook<https://www.facebook.com/OKFNetwork> |
Blog <http://blog.okfn.org/>  |  Newsletter<http://okfn.org/about/newsletter/>
-------------- próxima parte ----------
Um anexo em HTML foi limpo...
URL: <http://lists.okfn.org/pipermail/ckan-pt/attachments/20140514/cc1576f5/attachment-0003.html>


Mais informações acerca da lista ckan-pt