How to force update a plugin (syncthing)?

Status
Not open for further replies.

saurav

Contributor
Joined
Jul 29, 2012
Messages
139
While updating syncthing to v13, my browser disconnected. As expected, the update failed and syncthing won't start at all. So I restored it from a previous snapshot, and now it runs fine. The problem is, freenas thinks it is v13 (its in the sqlite db), while the version running is actually v12 (can be seen in Actions/About menu).

Now, how do I actually update it? I really need to update it because every other device has updated already and none of them can communicate with syncthing on freenas anymore because v12 => v13 is not a backward-compatible update.

I can think of some ways:

1. Reinstall and reconfigure everything. This is the safest, and also the most time-consuming way. I don't really want to do so much work.

2. Install a new instance of syncthing and then copy over all the files from /var/db/syncthing inside the old jail t the new jail. This may (mostly) take care of configuring the new installation, but I'd still need to reconfigure all the other devices that sync to it.

3. Install a new instance of syncthing v13 (a new jail, like in syncthing_2), and copy over all the v13 files to my existing v12 jail. The best way to do it (that I can think of) is with "rsync -pog --delete --links" so that ownership and permissions are preserved, symlinks are created with identical targets and extraneous files are deleted. It worked when I restored v12 from the snapshot. But that had the same jail for source & destination. Copying files from some other jail would likely require a lot of diff'ing and trial & error.

4. Backup the config.db, change the version of syncthing in plugins_plugins table, and restore freenas from that db. This looks like the least work, and also the riskiest. I'm not sure what I could lose by restoring from config.db, even if it takes only a couple of minutes to change the db and restore it back. Or whether this would be enough to actually force freenas to update syncthing.

Any other ideas?

Regards,
Saurav.
 

Nick2253

Wizard
Joined
Apr 21, 2014
Messages
1,633
Welcome to the wonderful world of the absolutely horrible plugin system.

Honestly, the best thing to do is create a new jail, and manually set up Syncthing in that jail. If you require reliable updates, this is, sadly, the only way to do it in my opinion. The plugin system has way too many random failure modes, and it's difficult to troubleshoot the problem or, more importantly, fix it so it doesn't happen again. Every plugin I've ever used has, at one time or another, run in to an update issue, so I finally just migrated all my plugins to either manual jails or to docker containers on my hypervisor.

When FreeNAS 10 comes out, hopefully I'll be able to migrate many of those containers back to FreeNAS, especially in the case of programs that work closely with my data.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
your first 2 opting would work.
I recommend another option though.
- upload a PBI for another plugin to the synthing jail
- delete your current syncthing plugin
- upload the v0.13.7 PBI for syncthing to your syncthing jail
- delete the extra plugin you installed
http://download.freenas.org/plugins/9/x64/

the plugin autoupdates, but not between major versions that change things I believe. that's why I had to release a new PBI for v0.13.7
 

saurav

Contributor
Joined
Jul 29, 2012
Messages
139
Thanks for your suggestion. Last night, I actually repaired the syncthing jail somehow, by a combination of 3 & 4. But I'm curious about your suggestion. Can you please explain the 1st step? By "uploading a PBI for another plugin to the syncthing jail", you mean just scp the pbi to somewhere in the syncthing jail? To which directory? And then just leave it there?

Wouldn't the next step remove it and the syncthing jail itself?
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Thanks for your suggestion. Last night, I actually repaired the syncthing jail somehow, by a combination of 3 & 4. But I'm curious about your suggestion. Can you please explain the 1st step? By "uploading a PBI for another plugin to the syncthing jail", you mean just scp the pbi to somewhere in the syncthing jail? To which directory? And then just leave it there?

Wouldn't the next step remove it and the syncthing jail itself?
you upload PBIs on the Jails tab, button looks like a box
you never delete the jail, and should not delete plugin jails directly. when a plugin jail has all of its plugins deleted it will get deleted automatically.
Isay to delete the plugin, which is available on the Plugins > Installed tab

by following that procedure, you can upgrade even a broken plugin. without losing data, the jail is never deleted because there is always a plugin installed to it. doing this procedure is actually faster then the normal PBI upgrade process
 
Status
Not open for further replies.
Top