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

Sync the server return 500 #270

Closed
momaek opened this issue Nov 18, 2023 · 9 comments · Fixed by #275
Closed

Sync the server return 500 #270

momaek opened this issue Nov 18, 2023 · 9 comments · Fixed by #275

Comments

@momaek
Copy link

momaek commented Nov 18, 2023

Server system: Alibaba Cloud Linux release 3 (Soaring Falcon)
Run in docker.
Logs:

time="2023-11-18T13:44:34Z" level=info msg="Listening on port: 3000"
time="2023-11-18T13:44:34Z" level=info msg="Using plain HTTP"
time="2023-11-18T13:44:36Z" level=info msg="[auth-middleware] UserId: root deviceId: {mydeviceID} newSync: true"
time="2023-11-18T13:44:36Z" level=info msg="connecting websocket from: root"
time="2023-11-18T13:44:36Z" level=info msg="[GIN] 2023/11/18 - 13:44:36 | 200 |     293.437µs |   {myip} | GET      \"/notifications/ws/json/1\""
time="2023-11-18T13:44:36Z" level=debug msg="hub: adding a client"
time="2023-11-18T13:44:36Z" level=info msg="[auth-middleware] UserId: root deviceId: {mydeviceID} newSync: true"
time="2023-11-18T13:44:36Z" level=debug msg="Fullpath: /data/users/root/sync/root"
time="2023-11-18T13:44:36Z" level=error msg="not found"
time="2023-11-18T13:44:36Z" level=info msg="[GIN] 2023/11/18 - 13:44:36 | 500 |      213.96µs |   {myip} | GET      \"/sync/v3/root\""
time="2023-11-18T13:44:37Z" level=info msg="[auth-middleware] UserId: root deviceId: {mydeviceID} newSync: true"
time="2023-11-18T13:44:37Z" level=debug msg="Fullpath: /data/users/root/sync/root"
time="2023-11-18T13:44:37Z" level=error msg="not found"
time="2023-11-18T13:44:37Z" level=info msg="[GIN] 2023/11/18 - 13:44:37 | 500 |     233.593µs |   {myip} | GET      \"/sync/v3/root\""
time="2023-11-18T13:44:40Z" level=info msg="[auth-middleware] UserId: root deviceId: {mydeviceID} newSync: true"
time="2023-11-18T13:44:40Z" level=debug msg="Fullpath: /data/users/root/sync/root"
time="2023-11-18T13:44:40Z" level=error msg="not found"
time="2023-11-18T13:44:40Z" level=info msg="[GIN] 2023/11/18 - 13:44:40 | 500 |      164.99µs |   {myIP} | GET      \"/sync/v3/root\""

Any ideas?

@momaek
Copy link
Author

momaek commented Nov 18, 2023

I've fixed the issue by uploading a file to the server.

@momaek momaek closed this as completed Nov 18, 2023
@borispulyer
Copy link

Argh...took me ages of unsuccessful searching until I found your fix. Works like a charm now! Thanks for sharing!

@nemunaire
Copy link
Collaborator

We need to fix this behavior.

I try to create a patch in order to avoid returning a 500 error. But it need tests from a new account.

@nemunaire nemunaire reopened this Nov 27, 2023
nemunaire added a commit to nemunaire/rmfakecloud that referenced this issue Nov 27, 2023
nemunaire added a commit to nemunaire/rmfakecloud that referenced this issue Nov 27, 2023
@Eeems
Copy link
Contributor

Eeems commented Nov 27, 2023

When I initially setup rmfakecloud I don't remember encountering this, but that might be because I was using toltec. So all of my documents were marked for resync as part of configuring my rmfakecloud server
https://github.com/toltec-dev/toltec/blob/7911eacd7256b0c813e496a41344757a7dcb2c2f/package/rmfakecloud-proxy/rmfakecloudctl#L76-L78

    # Mark all files as not synced
    grep sync "$xochitl_data_dir"/*.metadata -l \
        | xargs sed -i 's/synced\": true/synced\": false/'

So the documents on my device were immediately uploaded on the first sync.

@nemunaire
Copy link
Collaborator

This error appears since the introduction of the /sync/v3/root route, in v3.4.

I'll create a new account to test the patch, and use the command to mark all files are not synced. I think this should simulate the situation.

@nehlsen
Copy link

nehlsen commented Dec 19, 2023

I've fixed the issue by uploading a file to the server.

WARNING: to anybody trying this:
This will start a new sync and remove all existing Files from your device to replace them with the one uploaded to the server.

This will effectively wipe all your files. Happened to me :(
After this, everything works fine :)

nemunaire added a commit to nemunaire/rmfakecloud that referenced this issue Feb 8, 2024
@nunofgs
Copy link

nunofgs commented Feb 26, 2024

Thanks for the fix. Any chance we can get a release?

@nemunaire
Copy link
Collaborator

The expected answer is not a fake root, but a 404 with {"message":"root not found"}.

I'll fix this and make a release.

@nemunaire nemunaire reopened this Mar 20, 2024
@d2r
Copy link

d2r commented Sep 14, 2024

I've fixed the issue by uploading a file to the server.

This work-around was successful for me even with the /sync/v4 endpoints.

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.

7 participants