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

Tratar erro usuário não autorizado a publicar em alguma organização #177

Open
gabrielbdornas opened this issue Apr 8, 2022 · 0 comments

Comments

@gabrielbdornas
Copy link
Contributor

Erro ocorreu durante reunião hands-on Funed

(venv) ➜  indicadores-handson git:(main) dpckan dataset create
Criando conjunto: indicadores_handson
Traceback (most recent call last):
  File "/home/gabrielbdornas/.local/lib/python3.8/site-packages/dpckan/create_dataset.py", line 14, in create
    dataset_create(ckan_instance, local_datapackage, datastore)
  File "/home/gabrielbdornas/.local/lib/python3.8/site-packages/dpckan/functions.py", line 22, in dataset_create
    ckan_instance.call_action('package_create', remote_datapackage)
  File "/home/gabrielbdornas/.local/lib/python3.8/site-packages/ckanapi/remoteckan.py", line 93, in call_action
    return reverse_apicontroller_action(url, status, response)
  File "/home/gabrielbdornas/.local/lib/python3.8/site-packages/ckanapi/common.py", line 130, in reverse_apicontroller_action
    raise NotAuthorized(err)
ckanapi.errors.NotAuthorized: {'message': 'Acesso negado: O usuário gabrielbdornas não está autorizado a adicionar conjuntos de dados a essa organização', '__type': 'Authorization Error'}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/gabrielbdornas/.local/bin/dpckan", line 8, in <module>
    sys.exit(cli())
  File "/home/gabrielbdornas/.local/lib/python3.8/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/home/gabrielbdornas/.local/lib/python3.8/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/home/gabrielbdornas/.local/lib/python3.8/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/gabrielbdornas/.local/lib/python3.8/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/gabrielbdornas/.local/lib/python3.8/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/gabrielbdornas/.local/lib/python3.8/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/home/gabrielbdornas/.local/lib/python3.8/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/gabrielbdornas/.local/lib/python3.8/site-packages/dpckan/create_dataset.py", line 27, in create_cli
    create(ctx.obj['CKAN_HOST'], ctx.obj['CKAN_KEY'], ctx.obj['DATAPACKAGE'], ctx.obj['DATASTORE'])
  File "/home/gabrielbdornas/.local/lib/python3.8/site-packages/dpckan/create_dataset.py", line 17, in create
    delete_dataset(ckan_instance, local_datapackage.name)
  File "/home/gabrielbdornas/.local/lib/python3.8/site-packages/dpckan/functions.py", line 77, in delete_dataset
    ckan_instance.action.package_delete(id = dataset_name)
  File "/home/gabrielbdornas/.local/lib/python3.8/site-packages/ckanapi/common.py", line 51, in action
    return self._ckan.call_action(name, data_dict=kwargs)
  File "/home/gabrielbdornas/.local/lib/python3.8/site-packages/ckanapi/remoteckan.py", line 93, in call_action
    return reverse_apicontroller_action(url, status, response)
  File "/home/gabrielbdornas/.local/lib/python3.8/site-packages/ckanapi/common.py", line 128, in reverse_apicontroller_action
    raise NotFound(emessage)
ckanapi.errors.NotFound: Não encontrado
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant