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

Unauthorized esdedupe #11

Open
dipenpatel235 opened this issue Sep 29, 2021 · 10 comments
Open

Unauthorized esdedupe #11

dipenpatel235 opened this issue Sep 29, 2021 · 10 comments
Labels

Comments

@dipenpatel235
Copy link

dipenpatel235 commented Sep 29, 2021

i try below command and get error unauthorized.

docker run --rm deric/es-dedupe:latest esdedupe -H htttps://elastic_hostname -P 443 -i index_name \
-f md5 --user elastic_user --password "elastic_password"
@deric
Copy link
Owner

deric commented Sep 29, 2021

Try using the latest version:

docker run --rm deric/es-dedupe:v2.0.0 esdedupe -H elastic_hostname --noop

if you're using SSL, please use the --ssl flag:

docker run --rm deric/es-dedupe:v2.0.0 esdedupe -H elastic_hostname -P 443 --ssl -i index_name \
-f md5 --user elastic_user --password "elastic_password"

@dipenpatel235
Copy link
Author

dipenpatel235 commented Oct 1, 2021

@deric it's the same issue..
after that i have try using below command so using that authentication done successfully but getting other error now

docker run -it --rm deric/es-dedupe:latest esdedupe -H http://myuser:[email protected] -P 9200 -i "myindex" -f source_ip,feed_provider

so its giving below error and my given key name is correct

2021-10-01T12:46:41  [140129338693440] INFO  esdedupe Building documents mapping on index: myindex, batch size: 1000
Traceback (most recent call last):
  File "/usr/local/bin/esdedupe", line 11, in <module>
    load_entry_point('esdedupe==2.0.0', 'console_scripts', 'esdedupe')()
  File "/usr/local/lib/python3.7/dist-packages/esdedupe-2.0.0-py3.7.egg/esdedupe/cmd.py", line 67, in main
    lastcmd = ''
  File "/usr/local/lib/python3.7/dist-packages/esdedupe-2.0.0-py3.7.egg/esdedupe/esdedupe.py", line 109, in run
  File "/usr/local/lib/python3.7/dist-packages/esdedupe-2.0.0-py3.7.egg/esdedupe/esdedupe.py", line 169, in process_index
  File "/usr/local/lib/python3.7/dist-packages/esdedupe-2.0.0-py3.7.egg/esdedupe/esdedupe.py", line 188, in scan_and_remove
  File "/usr/local/lib/python3.7/dist-packages/esdedupe-2.0.0-py3.7.egg/esdedupe/esdedupe.py", line 178, in scan
  File "/usr/local/lib/python3.7/dist-packages/esdedupe-2.0.0-py3.7.egg/esdedupe/esdedupe.py", line 36, in build_index
KeyError: 'source_ip'

@deric
Copy link
Owner

deric commented Oct 1, 2021

That looks like different error than Unauthorized to me.

source_ip field is probably not included in all documents. Try running the command with higher verbosity:

docker run -it --rm deric/es-dedupe:latest esdedupe -H http://myuser:[email protected] -P 9200 -i "myindex" -f source_ip,feed_provider --level DEBUG --es-level DEBUG

@dipenpatel235
Copy link
Author

dipenpatel235 commented Oct 1, 2021 via email

@deric
Copy link
Owner

deric commented Oct 1, 2021

Then you can't use it as part of an unique key. I'll try to throw a better error message.

@dipenpatel235
Copy link
Author

dipenpatel235 commented Oct 1, 2021 via email

@dipenpatel235
Copy link
Author

@deric if the key field does not exist that I have fixed using the below method.
modified esdedupe.py line no 36 to below code. you can add this code block into your code and push it.

                try:
                    combined_key += str(hit['_source'][field])
                except Exception as e:
                    pass

@deric
Copy link
Owner

deric commented Oct 4, 2021

@dipenpatel235 That's not really a fix, rather a dirty-bomb which might lead to deleting all data from an index, if incorrect field name is used.

@deric deric added the question label Oct 4, 2021
@dipenpatel235
Copy link
Author

dipenpatel235 commented Oct 4, 2021 via email

@adhaamehab
Copy link

I had the same issue when passing --user and --password, the workaround is to pass the host as
https://user:password@host:port and pass --ssl

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