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

Bogus records in database makes plugin to skip database metrics at all #7

Closed
antonsoroko opened this issue Dec 1, 2021 · 4 comments · Fixed by #8
Closed

Bogus records in database makes plugin to skip database metrics at all #7

antonsoroko opened this issue Dec 1, 2021 · 4 comments · Fixed by #8

Comments

@antonsoroko
Copy link

e.g. for redis database plugin - bogus keys (members) in "ve:pkgs" key makes plugin to skip database metrics at all
(in this case test is some bogus record in database)

WARN: Failed to collect database metrics due to NotFoundError: package test's package.json not found
    at getError (/usr/local/lib/node_modules/verdaccio/node_modules/verdaccio-redis-storage/node_modules/@verdaccio/commons-api/lib/index.js:113:45)
    at getNotFound (/usr/local/lib/node_modules/verdaccio/node_modules/verdaccio-redis-storage/node_modules/@verdaccio/commons-api/lib/index.js:147:10)
    at StoragePluginManager.readPackageAsync (/usr/local/lib/node_modules/verdaccio/node_modules/verdaccio-redis-storage/lib/PackageStorage.js:204:43)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)

we had some leftovers after migration - but anyway it makes sense to ignore such errors and not stop processing, imho.

thank you!

@danopia
Copy link
Member

danopia commented Dec 1, 2021

Hello, I attached a PR to address this by logging the bad package's names and moving on. I suppose it could be a metric instead but knowing which package has the issue is more useful I think, so the record can be cleaned up.

Are you still on Verdaccio 4? I'm going to be updating dependencies on this plugin to Verdaccio 5, and wasn't planning on making a further Verdaccio 4 release 😄

@danopia danopia closed this as completed in #8 Dec 1, 2021
@antonsoroko
Copy link
Author

antonsoroko commented Dec 1, 2021

Hi. Thank you!
I use Verdaccio 5.

but knowing which package has the issue is more useful I think

Agree.

@danopia
Copy link
Member

danopia commented Dec 1, 2021

I've released this small patch as v1.1.1 and verified with my own deployment (on Google Cloud backend), getting a log line like this:

WARN: Failed to fetch local package "@repro/missing-package" for database metrics: no such package available

I'll ship 1.2.0 next targeting Verdaccio 5.

Thanks for reporting :)

@antonsoroko
Copy link
Author

Cool. I already see it in https://www.npmjs.com/package/verdaccio-openmetrics

Thank you very much for the quick fix!

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

Successfully merging a pull request may close this issue.

2 participants