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

Bad url parsing in docstore.delete #176

Open
densho opened this issue Dec 16, 2019 · 3 comments
Open

Bad url parsing in docstore.delete #176

densho opened this issue Dec 16, 2019 · 3 comments
Assignees
Labels

Comments

@densho
Copy link
Collaborator

densho commented Dec 16, 2019

The syntax for the string formatter that passes the ES host and port to the requests module in docstore.delete is incorrect causing an error when the code attempts to connect to ES.

Note that the item is still successfully deleted from the repo (in this case, it was a File.delete) even though the indexing operation fails. The repo was left in a good state with no hanging commits.

Traceback reads:

  File "/opt/ddr-local/venv/ddrlocal/local/lib/python2.7/site-packages/celery/app/trace.py", line 240, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/opt/ddr-local/venv/ddrlocal/local/lib/python2.7/site-packages/celery/app/trace.py", line 438, in __protected_call__
    return self.run(*args, **kwargs)
  File "/opt/ddr-local/ddrlocal/webui/tasks/files.py", line 405, in delete_file
    ds.delete(file_.id)
  File "/opt/ddr-local/venv/ddrlocal/local/lib/python2.7/site-packages/ddr_cmdln-0.9.4b0-py2.7.egg/DDR/docstore.py", line 771, in delete
    r = requests.request('DELETE', url)
  File "/opt/ddr-local/venv/ddrlocal/local/lib/python2.7/site-packages/requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "/opt/ddr-local/venv/ddrlocal/local/lib/python2.7/site-packages/requests/sessions.py", line 519, in request
    prep = self.prepare_request(req)
  File "/opt/ddr-local/venv/ddrlocal/local/lib/python2.7/site-packages/requests/sessions.py", line 462, in prepare_request
    hooks=merge_hooks(request.hooks, self.hooks),
  File "/opt/ddr-local/venv/ddrlocal/local/lib/python2.7/site-packages/requests/models.py", line 313, in prepare
    self.prepare_url(url, params)
  File "/opt/ddr-local/venv/ddrlocal/local/lib/python2.7/site-packages/requests/models.py", line 381, in prepare_url
    raise InvalidURL(*e.args)
InvalidURL: Failed to parse: http://[{'host': '10.0.1.135', 'port': '9200'}]/ddrfile/_doc/ddr-pc-44-50-mezzanine-43a80d022e/

See:
https://github.com/densho/ddr-cmdln/blob/master/ddr/DDR/docstore.py#L766

@densho
Copy link
Collaborator Author

densho commented Dec 17, 2019

TODO: @pkikawa Please check that indexing is off in ddrlocal-local.cfg

@pkikawa
Copy link
Collaborator

pkikawa commented Dec 17, 2019

i checked her ddrlocal-local.cfg and it was set to TRUE - i have now changed it to FALSE

i tested deleting a binary on my vm with indexing disabled and it did NOT throw the failure message.

closing issue.

@pkikawa pkikawa closed this as completed Dec 17, 2019
@pkikawa pkikawa reopened this Dec 17, 2019
@pkikawa
Copy link
Collaborator

pkikawa commented Dec 17, 2019

or actually did we want it open?

@pkikawa pkikawa closed this as completed Dec 17, 2019
@pkikawa pkikawa reopened this Dec 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants