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

Corrupted file error in multiprocessing mode #996

Closed
tjb9dc opened this issue Jan 19, 2024 · 2 comments
Closed

Corrupted file error in multiprocessing mode #996

tjb9dc opened this issue Jan 19, 2024 · 2 comments

Comments

@tjb9dc
Copy link

tjb9dc commented Jan 19, 2024

We recently upgraded from 0.16.0 to 0.19.0 (to get the mostrecent addition in #967) and are running into the following error when calling generate_latest() after restarting our server:

  File "python3.10/site-packages/prometheus_client/exposition.py", line 251, in generate_latest
    for metric in registry.collect():
  File "python3.10/site-packages/prometheus_client/registry.py", line 97, in collect
    yield from collector.collect()
  File "python3.10/site-packages/prometheus_client/multiprocess.py", line 158, in collect
    return self.merge(files, accumulate=True)
  File "python3.10/site-packages/prometheus_client/multiprocess.py", line 43, in merge
    metrics = MultiProcessCollector._read_metrics(files)
  File "python3.10/site-packages/prometheus_client/multiprocess.py", line 71, in _read_metrics
    for key, value, timestamp, _ in file_values:
  File "python3.10/site-packages/prometheus_client/mmap_dict.py", line 40, in _read_all_values
    raise RuntimeError('Read beyond file size detected, file is corrupted.')
RuntimeError: Read beyond file size detected, file is corrupted.
@tjb9dc
Copy link
Author

tjb9dc commented Jan 19, 2024

hmm actually wondering if we have a stale file lying around that's been written to by multiple versions

@tjb9dc
Copy link
Author

tjb9dc commented Jan 19, 2024

Ah yes disregard -- we had our multiprocess DB files lying around and they had been written to by both versions. This was only a problem for us in local dev because we don't wipe the multiprocess dir, but we might do that going forward.

Apologies for the noise! We love the mostrecent new mode :)

@tjb9dc tjb9dc closed this as completed Jan 19, 2024
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

1 participant