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

visit:locate options broken #1471

Closed
Sylonin opened this issue Jun 26, 2022 · 2 comments · Fixed by #1489
Closed

visit:locate options broken #1471

Sylonin opened this issue Jun 26, 2022 · 2 comments · Fixed by #1489
Labels
Milestone

Comments

@Sylonin
Copy link

Sylonin commented Jun 26, 2022

How Shlink is set-up

Summary

The -a and -r options for visit:locale are unrecognised despite being present in --help

/etc/shlink # shlink visit:locate -a -r


 [WARNING] You are about to process the location of all existing visits your short URLs received.

           Since shlink saves visitors IP addresses anonymized, you could end up losing precision on some of your
           visits.

           Also, if you have a large amount of visits, this can be a very time consuming process. Continue at your own
           risk.


 Do you want to proceed? (yes/no) [no]:
 > yes


 [ERROR] The "-a" option does not exist.


/etc/shlink # shlink visit:locate -r -a


 [WARNING] You are about to process the location of all existing visits your short URLs received.

           Since shlink saves visitors IP addresses anonymized, you could end up losing precision on some of your
           visits.

           Also, if you have a large amount of visits, this can be a very time consuming process. Continue at your own
           risk.


 Do you want to proceed? (yes/no) [no]:
 > yes


 [ERROR] The "-r" option does not exist.


/etc/shlink # shlink visit:locate --retry --all


 [WARNING] You are about to process the location of all existing visits your short URLs received.

           Since shlink saves visitors IP addresses anonymized, you could end up losing precision on some of your
           visits.

           Also, if you have a large amount of visits, this can be a very time consuming process. Continue at your own
           risk.


 Do you want to proceed? (yes/no) [no]:
 > yes


 [ERROR] The "--retry" option does not exist.



Current behavior

Expected behavior

The --all and --retry options for visit:locate work

How to reproduce

Try and use -a and -r options

@Sylonin Sylonin added the bug label Jun 26, 2022
@acelaya
Copy link
Member

acelaya commented Jun 29, 2022

Hmm, this is weird. The CLI flags are handled by a framework, and the warning message you see means it was able to detect them as known just before throwing an error.

The error is also thrown by the framework itself, when you pass unknown options or flags.

I will investigate.

@acelaya acelaya added this to the 3.2.0 milestone Jun 29, 2022
@acelaya acelaya added this to Shlink Aug 1, 2022
@acelaya acelaya moved this to Todo in Shlink Aug 1, 2022
@acelaya acelaya moved this from Todo to In Progress in Shlink Aug 1, 2022
@acelaya acelaya changed the title visit:locale options broken visit:locate options broken Aug 1, 2022
@acelaya acelaya moved this from In Progress to In review in Shlink Aug 1, 2022
@acelaya
Copy link
Member

acelaya commented Aug 1, 2022

I found the issue.

This command internally runs the visit:download-db command, in order to make sure the database isupdated before trying to locate the visits. When doing so, it was passing its own options to this one by mistake.

Since the second command was not expecting any option, this combination worked as long as you were not passing any argument/flag to visit:locate, but failed as soon as any param was provided, like --retry and --all.

Repository owner moved this from In review to Done in Shlink Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants