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

Invalid Semantic Version #14

Open
christopher-aldred opened this issue Oct 5, 2023 · 3 comments
Open

Invalid Semantic Version #14

christopher-aldred opened this issue Oct 5, 2023 · 3 comments

Comments

@christopher-aldred
Copy link

I have downloaded cicada-0.0.8.zip and am trying to execute the binary on Linux Cent OS 7.
When i run ./cicada i get the following output and nothing else: 'Invalid Semantic Version'

The cicada.yaml contains the following lines:

debug: true
lead_months: 1

version_queries:
mongodb:
command: ["mongod", "--version"]
pattern: "^db version v(?P[0-9\.]+)$"

@alexm
Copy link

alexm commented Oct 7, 2023

Same here with Debian 12 and the example/cicada.yaml.

@mcandre
Copy link
Owner

mcandre commented Oct 22, 2023

cicada uses the github.com/Masterminds/semver library, which may present vague error messages.

Perhaps a new version of the dependency presents better error messages. A quick check reveals several major version bumps to this package. We could experiment with upgrading the dependency. It's a semver library, so it shouldn't be too difficult to incorporate any API changes that may come with the upgrades.

Meanwhile, we could adjust the error handling logic to wrap the dependency's error message in a larger message that provides more context.

I suspect that escape syntax in the regular expression may be a factor.

However, some MongoDB users are actually reporting that the version command itself can fail in certain wild circumstances, e.g. https://stackoverflow.com/questions/67075818/mongo-version-and-mongod-version-commands-cannot-be-run-successfully-from . If this is the case, then it is entirely possible that zero bytes are written to the subprocess's stdout stream, in which case the regex would have nothing to match.

More generally, if mongodb is not in PATH or the current user does not have permission to run the executable, then similar results may occur.

Run the command manually and confirm that it does, in fact, produce the expected output.

Please share the output.

I've been applying for tech roles for 19 months without any employer taking me seriously. So I fear I don't have much time or inclination to continue contributing much longer.

@mcandre
Copy link
Owner

mcandre commented Jan 13, 2024

Note that you're missing the Version capture group name in that regex:

pattern: "^db version v(?P[0-9.]+)$"

It should look closer to:

pattern: "^db version v(?PVersion[0-9.]+)$"

See the demo cicada.yaml file in the example directory.

Apart from Go capture group regexp syntax, I have also identified some bugs with how cicada queries component versions. I plan to release a new version of cicada soon.

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

3 participants