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

Seafile doesn't sync all objects in git repos #2677

Open
allo- opened this issue May 26, 2023 · 13 comments
Open

Seafile doesn't sync all objects in git repos #2677

allo- opened this issue May 26, 2023 · 13 comments

Comments

@allo-
Copy link
Contributor

allo- commented May 26, 2023

Many times when I put a git repo into a Seafile library, Seafile does not sync all objects. When I backup the repo and compare it afterward, some files in the object store are completely missing. I do not have a seafile-ignore.txt file in the library and no other idea why the files are ignored. Syncing other folders works without missing files.

@feiniks
Copy link
Contributor

feiniks commented May 27, 2023

Hello @allo- , seafile will ignore uploading temporary files generated on linux by default, ending with ~. If you have such files in your local directory, these files will not be uploaded.

@allo-
Copy link
Contributor Author

allo- commented May 28, 2023

My problem are files in .git/objects/XX/ which have hexadecimal coded hashes as names.

@feiniks
Copy link
Contributor

feiniks commented May 29, 2023

Hello @allo- , how did you upload this directory? When uploading through a browser, the system may ignore these hidden files of git. You can try to upload through the client.

@allo-
Copy link
Contributor Author

allo- commented May 29, 2023

No, I am working with the repo in a synced folder. On the other computer, git always crashes when I added commits and when I look at the problem there are just files missing in the .git folder.

When I create a tar of the .git folder I can extract it afterward on the other computer and find that it contains some files in the objects folder, which are not in the synced .git/objects folder. Not all are missing, but some.

With git clone I would have thought that hardlinks could be a problem, but the repo was not cloned on the same filesystem and after a new commit, the new objects are unique, so they are just regular files not linked to another file. I wonder if git creates them in another unusual way that Seafile doesn't always handle correctly. Maybe something like the files being created (too) fast after each other or created as temp file and then renamed?

@feiniks
Copy link
Contributor

feiniks commented May 29, 2023

Hello @allo-, if the client does not upload the .git directory at all, it means that the client is working normally. This problem may be related to the working mechanism of git. .git is the metadata directory of git. Seafile client will only upload the current directory status to the server. Other clients may have synchronized an intermediate state. You'd better synchronize the git repository through the synchronization mechanism of git itself, and the .git directory does not need to be copied.

@allo-
Copy link
Contributor Author

allo- commented May 29, 2023

It does upload most of it and I want it to upload it (yeah, there are better ways to push git data around ... still I want it for some versioned folders). I am not talking about a shallow clone, but a full repo inside the .git folder of the project, so not only metadata, but the full repository content.

I am not aware of a blacklist that prevents syncing the git folder. If there is any it is not working very well and I would like to be able to turn it off.

@feiniks
Copy link
Contributor

feiniks commented May 29, 2023

Hello @allo- , in my case, all the files under the .git directory can be uploaded normally. Can you provide a more complete test procedure? Or you can check seafile.log and events.log to see if there is an error during the upload process that prevents the corresponding file from being uploaded.

@allo-
Copy link
Contributor Author

allo- commented May 29, 2023

I can check the logs next time again. I've never seen an error (like having the sync error indicator on the tray icon). I'll look into the logs next time I sync from the other location. Are there any specific tests I can do then?

@allo-
Copy link
Contributor Author

allo- commented Mar 21, 2024

I've made a diff what's missing for a repo (difference between "find >files.txt" on both sides) and four objects are not synced:

-./.git/objects/85/f3f1d6066b1d7aacd0913c65a23fbef32bb250
-./.git/objects/ee/35b6ba1bcc42ad8ea05c1758e1bdb6312c6894
-./.git/objects/f6/d929a2e6b350ba72d01760120f2c7c4f078b77
-./.git/objects/f9/5443e70fb34583fc152871082c354ec745a3cf

The files are not different but completely missing on the side where the repository is broken. I think the files are not different from other objects in the repo. Maybe git writes the files in some way or sets timestamps that may be a bit in the past or similar problems that prevent the seafile client from detecting the change?

@feiniks
Copy link
Contributor

feiniks commented Mar 22, 2024

Hello @allo-, which version of the client are you using?

@allo-
Copy link
Contributor Author

allo- commented Mar 22, 2024

On the end where the new files exist (and weren't uploaded): 8.0.5 (Ubuntu)
On the receiving end: 9.0.4 (Debian Testing)
When forcing a resync I see in the web interface that the few missing files are uploaded (i.e. they were missing on the server before), so I think it is not a problem of the client downloading the files.

But I have the problems since a longer time with updates in the meantime and I think its only now the 8 -> 9 thing and may have happened in the other direction as well.

Forcing a resync of the library successfully adds the missing files to the repo. The problem is, that I am on the wrong computer to force the resync when I notice that a git repo doesn't work because of missing files.

@feiniks
Copy link
Contributor

feiniks commented Mar 22, 2024

Hello @allo- , I think 8.0.5 is an older version, and there may be some bugs in this version that are causing problems.

Please upgrade to the latest version and see if you still have problems.

@allo-
Copy link
Contributor Author

allo- commented Mar 22, 2024

It's from the Ubuntu Repos. I can upgrade next week to another version.

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

2 participants