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

Check folder status before checking ignores #187

Closed
AudriusButkevicius opened this issue Dec 30, 2015 · 21 comments
Closed

Check folder status before checking ignores #187

AudriusButkevicius opened this issue Dec 30, 2015 · 21 comments

Comments

@AudriusButkevicius
Copy link

Related to:
syncthing/syncthing#2630

@canton7
Copy link
Owner

canton7 commented Dec 30, 2015

So Syncthing will return 500 for /rest/db/ignores if the folder is unhealthy?

@AudriusButkevicius
Copy link
Author

yeah, though that could mean other errors, so it's best to check the status, before you check the ignores.

@canton7
Copy link
Owner

canton7 commented Jan 1, 2016

Actually, I do check the invalid field of the folder config before trying to fetch ignores. However, in the case of a missing folder marker this field is never set.

Later on, I get a FolderStatus event, where the invalid field is empty (still) but the State field is set to "error". However this is too late: I've already started fetching the ignores, sync state, started constructing its path, etc.

The FolderStatus event isn't documented, and neither is the structure of the config, so I'm not sure how invalid and State=error are supposed to relate, or what exactly they're supposed to indicate.

@AudriusButkevicius
Copy link
Author

I think the error field is set in the config.

@scienmind
Copy link
Contributor

If of any use - some info from Windows Event Logs for the crashing SyncTrayzor (v.1.0.32)

Application Error:

Faulting application name: SyncTrayzor.exe, version: 1.0.32.183, time stamp: 0x5659ddb2
Faulting module name: KERNELBASE.dll, version: 6.1.7601.19045, time stamp: 0x56259271
Exception code: 0xe0434352
Fault offset: 0x000000000000b3dd
Faulting process id: 0x242c
Faulting application start time: 0x01d14484713abd0d
Faulting application path: C:\Program Files\SyncTrayzor\SyncTrayzor.exe
Faulting module path: C:\Windows\system32\KERNELBASE.dll
Report Id: 8941d9a1-b07b-11e5-a0d4-da3cd1620030

.NET Runtime:

Application: SyncTrayzor.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: SyncTrayzor.SyncThing.SyncThingDidNotStartCorrectlyException
Stack:
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<ThrowAsync>b__5(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()

@canton7
Copy link
Owner

canton7 commented Jan 1, 2016

Ah righty, I'll check that when I'm next near a computer. Did the state field replace the invalid field, then? If so, in what version?

@scienmind thanks - I think I know what's happening: syncthing changed some details of the API and I wasn't aware. Just need to figure out how best to resolve it.

@scienmind
Copy link
Contributor

API change seem reasonable to blame.
I've been running the same setup for a while now, and this mess wasn't present until recently. Up until Syncthing v.0.12.7 it was fine, and now I re-enabled auto-update, updating directly to v.0.12.10. Having this issue since then.

@AudriusButkevicius
Copy link
Author

I don't think we've changed anything in the API

@canton7
Copy link
Owner

canton7 commented Jan 1, 2016

This case used to appear as a value in the config's invalid field and apparently it no longer does (although we might well be talking around the v0.10 era).

@AudriusButkevicius
Copy link
Author

It should still appear there. If it's not, there is an issue.

@canton7
Copy link
Owner

canton7 commented Jan 1, 2016

Actually, I do check the invalid field of the folder config before trying to fetch ignores. However, in the case of a missing folder marker this field is never set.

Later on, I get a FolderStatus event, where the invalid field is empty (still) but the State field is set to "error". However this is too late: I've already started fetching the ignores, sync state, started constructing its path, etc.

It no longer appears there.

@canton7
Copy link
Owner

canton7 commented Jan 1, 2016

I think the error field is set in the config.

I don't see an error field. This is the config that's fetched:

   "folders":[
      {
         "id":"default",
         "path":"C:\\Users\\Antony\\Sync",
         "devices":[
            {
               "deviceID":"XXXXX"
            }
         ],
         "readOnly":false,
         "rescanIntervalS":60,
         "ignorePerms":false,
         "autoNormalize":false,
         "minDiskFreePct":1,
         "versioning":{
            "type":"",
            "params":{

            }
         },
         "copiers":0,
         "pullers":0,
         "hashers":0,
         "order":"random",
         "ignoreDelete":false,
         "scanProgressIntervalS":0,
         "pullerSleepS":0,
         "pullerPauseS":0,
         "maxConflicts":-1,
         "disableSparseFiles":false,
         "invalid":""
      }
   ],

@AudriusButkevicius
Copy link
Author

Well invalid holds the error, hence I call it error field :D

@canton7
Copy link
Owner

canton7 commented Jan 1, 2016

Heh, ok then! That clears things up slightly - I wasn't sure whether you were referring to the State field being set to Error...

Even so, it doesn't look like the field is being set, whatever it's called :D

@AudriusButkevicius
Copy link
Author

If you remove the marker, rescan, it should be set.

@canton7
Copy link
Owner

canton7 commented Jan 1, 2016

If I remove the marker and restart - which is the case that causes the reported problem, and a case which used to work - it isn't set. That is why this issue is open

@AudriusButkevicius
Copy link
Author

Ok I guess we can close this, and open up one in syncthing.

canton7 added a commit that referenced this issue Jan 12, 2016
Folders can unfail at any point. Don't fetch ignores for failed folders,
but do fetch ignores when they unfail. Don't watch failed folders.

Fixes #187
@scienmind
Copy link
Contributor

@canton7 are the recent commits meant to work around the syncthing's behavior and fix the issue?

Tried re-adding the external drive's folder today, and when unmounted, the console is still flooded with those:

[XXXXX] 07:10:05 INFO: Skipping folder removable_folder scan due to folder error: folder path missing
[XXXXX] 07:28:24 INFO: Skipping folder removable_folder scan due to folder error: folder path missing
[XXXXX] 07:47:01 INFO: Skipping folder removable_folder scan due to folder error: folder path missing
[XXXXX] 08:05:13 INFO: Skipping folder removable_folder scan due to folder error: folder path missing
[XXXXX] 08:21:57 INFO: Skipping folder removable_folder scan due to folder error: folder path missing
[XXXXX] 08:33:27 INFO: Skipping folder removable_folder scan due to folder error: folder path missing
[XXXXX] 08:48:52 INFO: Skipping folder removable_folder scan due to folder error: folder path missing
[XXXXX] 09:06:21 INFO: Skipping folder removable_folder scan due to folder error: folder path missing

On the plus side, it hasn't crashed yet, but maybe i'm just lucky/haven't waited enough...

@AudriusButkevicius
Copy link
Author

The log os expected, it tells you why the folder is not working.

@canton7
Copy link
Owner

canton7 commented Jan 16, 2016

Yeah, that's just what syncthing does when you have a folder missing. SyncTrayzor is working fine, and Syncthing is also working as designed.

@scienmind
Copy link
Contributor

OK, then I assume I can resurrect the syncing of all unmountable folders. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants