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

How to re-generate correct MANIFEST file? #662

Closed
xingao0803 opened this issue Nov 2, 2017 · 11 comments
Closed

How to re-generate correct MANIFEST file? #662

xingao0803 opened this issue Nov 2, 2017 · 11 comments

Comments

@xingao0803
Copy link

How to re-generate correct MANIFEST file?

Detailed Description

Our aptly server was shutdown suddenly. When we restarted it, seems aptly db crashed. The MANIFEST file only has 0 bytes.
And we always get error like:
ERROR: can't open database: leveldb: manifest corrupted (field 'comparer'): missing [file=MANIFEST-1197260]
We run "aptly db recover" to recover db, but still got the same issue.

How can I recover the db and re-generate the correct MANIFEST file?

Thanks.

Context

Possible Implementation

Your Environment

@xingao0803
Copy link
Author

The error in LOG file like:
=============== Nov 2, 2017 (UTC) ===============
08:56:04.755149 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed

@smira
Copy link
Contributor

smira commented Nov 3, 2017

@syndtr could you please chime in?

I believe you can try removing corrupted MANIFEST file (which is part of error message) and try running aptly db recover which should rebuild MANIFEST from SSTables. But please make sure you have backup of db/ first!

@smira smira added the question label Nov 3, 2017
@syndtr
Copy link

syndtr commented Nov 5, 2017

Hmm, this is strange DB.Recover should also creates new MANIFEST file. @xingao0803 is it works if you remove the corrupted MANIFEST file first as @smira sugested?

@smira
Copy link
Contributor

smira commented Nov 7, 2017

I wonder if related to #654

smira added a commit that referenced this issue Nov 8, 2017
Update goleveldb vendored dependency (see #662)
@smira smira added the 1.2.0 label Nov 10, 2017
@smira smira added 1.3.0 and removed 1.2.0 labels Dec 5, 2017
@mevatron
Copy link

mevatron commented Feb 9, 2018

I'm also seeing this issue as soon as I upgrade from 1.1.1 to 1.2.0.

I tried removing the MANIFEST file and regenerating it with aptly db recover

But, it fails with

syncDir: sync /media/xen/apt/db: invalid argument

Any ideas I could additionally try?

@smira
Copy link
Contributor

smira commented Feb 9, 2018

@mevatron what kind of filesystem is that? It complains on fsync() I believe?

@mevatron
Copy link

mevatron commented Feb 9, 2018

@smira This is a cifs mounted filesystem.

@smira
Copy link
Contributor

smira commented Feb 9, 2018

I don't think this is supposed to work with goleveldb. Do you have a chance to try to copy to local filesystem and run aptly db recover?

@mevatron
Copy link

mevatron commented Feb 9, 2018

@smira I just rsync'd the apt folder down locally and I am able to run aptly db recover successfully. So, currently I have a CI system and a developer box that both publish packages to the aptly repo, and they have been interacting with it using a network filesystem. What would be the best way to cover this use case do you think?

Thanks for all the assistance!

@smira
Copy link
Contributor

smira commented Feb 9, 2018

@mevatron aptly doesn't support network filesystems neither for DB nor for pool directory, as this is going to cause issues. the best way of course it use aptly as a service and interact via API

@mevatron
Copy link

mevatron commented Feb 9, 2018

@smira Thanks I didn't realize I could interact with it via REST API. I will definitely convert my workflow over to that!

@smira smira closed this as completed Mar 31, 2018
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

4 participants