anyproto / any-sync-dockercompose

docker-compose for testing any-sync
MIT License
234 stars 29 forks source link

File Sync: Synchronized files are automatically deleted #50

Closed mediocrebaby closed 1 month ago

mediocrebaby commented 1 month ago

Have you read a contributing guide?

Current Behavior

When I use anytype on new computer to access my self-managed vault, synchronized files are automatically deleted. Then I clicked into the space, and I found that the space capacity in the remote storage had become 0B. View the log of any-sync-filenode on the deployment server and find that the log reports the following error: image

Expected Behavior

Files are successfully synchronized on new computer.

Steps To Reproduce

  1. Create vault on a computer and upload files.
  2. Visit the vault for the first time on another computer.
  3. Enviroment: Two computers are not in the same local area network. When the new computer visits the vault, the client of another computer should exit completely

Environment

- OS: Ubuntu 22.04
- Version:v4.0.2

Anything else?

No response

mediocrebaby commented 1 month ago

After my investigation, I found that the key-value pairs in my Redis were deleted. I would like to ask whether Redis is used for caching or for persistent storage. If it is used for caching, but my MongoDB does not contain any data related to images, please help me. Thank you.

fb929 commented 1 month ago

I could not reproduce it. If I understand correctly, you want to synchronize between two clients using only the server, i.e., exclude P2P synchronization between the clients themselves. In that case, you need to make sure that client number 1 has fully synchronized its files to the server (in older versions of the client, there was a 5-minute file synchronization lag issue). Also, your phrase "Two computers are not in the same local area network" confuses me - check that both clients have access to the server and that the client.xml contains the address through which the clients can connect to the server.

fb929 commented 1 month ago

I found that the key-value pairs in my Redis were deleted.

This is normal behavior. For Redis, we have implemented a system for offloading "cold" data to S3 to reduce the size of memory usage.

mediocrebaby commented 1 month ago

I've identified the issue—it appears to be due to the server hardware not being supported. Since I don't have a public IP, I opted to set up the self-hosted service on a rented public server. However, the server's specifications are only 2 cores and 2GB of RAM. This led to a problem where Redis, after storing timeout data in MinIO, was unable to retrieve the stored data from MinIO, resulting in file synchronization failures. Currently, following a friend's advice, I have set up the service on a server at home and resolved the issue through internal network penetration. If there's time, I suggest providing an updated set of minimum specifications.