-
-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Syncthing NixOS module jq
based config script doesn't merge folders correctly
#230146
Labels
Comments
doronbehar
added a commit
to doronbehar/nixpkgs
that referenced
this issue
May 5, 2023
If one sets either of `override{Device,folder}s` to false, the jq `*` operator doesn't merge well the devices and folders, creating duplicate IDs for folders as observed in NixOS#230146. This PR makes the script iterate via a Bash for loop the devices and folders IDs and merges the keys using upstream's `curl -X PATCH` support, and support for setting settings per individual folders and devices via ID in the URL. Hence this commit fixes NixOS#230146.
doronbehar
added a commit
to doronbehar/nixpkgs
that referenced
this issue
May 5, 2023
If one sets either of `override{Device,folder}s` to false, the jq `*` operator doesn't merge well the devices and folders, creating duplicate IDs for folders as observed in NixOS#230146. This PR makes the script iterate via a Bash for loop the devices and folders IDs and merges the keys using upstream's `curl -X PATCH` support, and support for setting settings per individual folders and devices via ID in the URL. Hence this commit fixes NixOS#230146.
12 tasks
doronbehar
added a commit
to doronbehar/nixpkgs
that referenced
this issue
May 5, 2023
If one sets either of `override{Device,folder}s` to false, the jq `*` operator doesn't merge well the devices and folders, creating duplicate IDs for folders as observed in NixOS#230146. This PR makes the script iterate via a Bash for loop the devices and folders IDs and merges the keys using upstream's `curl -X PATCH` support for single objects. Hence this commit fixes NixOS#230146.
12 tasks
doronbehar
added a commit
to doronbehar/nixpkgs
that referenced
this issue
May 16, 2023
If one sets either of `override{Device,folder}s` to false, the jq `*` operator doesn't merge well the devices and folders, creating duplicate IDs for folders as observed in NixOS#230146. This PR makes the script iterate via a Bash for loop the devices and folders IDs and merges the keys using upstream's `curl -X PATCH` support for single objects. Hence this commit fixes NixOS#230146.
doronbehar
added a commit
to doronbehar/nixpkgs
that referenced
this issue
May 16, 2023
If one sets either of `override{Device,folder}s` to false, the jq `*` operator doesn't merge well the devices and folders, creating duplicate IDs for folders as observed in NixOS#230146. This PR makes the script iterate via a Bash for loop the devices and folders IDs and merges the keys using upstream's `curl -X PATCH` support for single objects. Hence this commit fixes NixOS#230146.
doronbehar
added a commit
to doronbehar/nixpkgs
that referenced
this issue
May 17, 2023
If one sets either of `override{Device,folder}s` to false, the jq `*` operator doesn't merge well the devices and folders, creating duplicate IDs for folders as observed in NixOS#230146. This PR makes the script iterate via a Bash for loop the devices and folders IDs and merges the keys using upstream's `curl -X PATCH` support for single objects. Hence this commit fixes NixOS#230146.
doronbehar
added a commit
to doronbehar/nixpkgs
that referenced
this issue
May 18, 2023
If one sets either of `override{Device,folder}s` to false, the jq `*` operator doesn't merge well the devices and folders, creating duplicate IDs for folders as observed in NixOS#230146. This PR makes the script iterate via a Bash for loop the devices and folders IDs and merges the keys using upstream's `curl -X PATCH` support for single objects. Hence this commit fixes NixOS#230146.
doronbehar
added a commit
to doronbehar/nixpkgs
that referenced
this issue
Jun 8, 2023
If one sets either of `override{Device,folder}s` to false, the jq `*` operator doesn't merge well the devices and folders, creating duplicate IDs for folders as observed in NixOS#230146. This PR makes the script iterate via a Bash for loop the devices and folders IDs and merges the keys using upstream's `curl -X PATCH` support for single objects. Hence this commit fixes NixOS#230146.
doronbehar
added a commit
to doronbehar/nixpkgs
that referenced
this issue
Jun 18, 2023
If one sets either of `override{Device,folder}s` to false, the jq `*` operator doesn't merge well the devices and folders, creating duplicate IDs for folders as observed in NixOS#230146. This PR makes the script iterate via a Bash for loop the devices and folders IDs and merges the keys using upstream's `curl -X PATCH` support for single objects. Hence this commit fixes NixOS#230146.
doronbehar
added a commit
to doronbehar/nixpkgs
that referenced
this issue
Jun 29, 2023
If one sets either of `override{Device,folder}s` to false, the jq `*` operator doesn't merge well the devices and folders, creating duplicate IDs for folders as observed in NixOS#230146. This PR makes the script iterate via a Bash for loop the devices and folders IDs and merges the keys using upstream's `curl -X PATCH` support for single objects. Hence this commit fixes NixOS#230146.
doronbehar
added a commit
to doronbehar/nixpkgs
that referenced
this issue
Jun 30, 2023
If one sets either of `override{Device,folder}s` to false, the jq `*` operator doesn't merge well the devices and folders, creating duplicate IDs for folders as observed in NixOS#230146. This PR makes the script iterate via a Bash for loop the devices and folders IDs and merges the keys using upstream's `curl -X PATCH` support for single objects. Hence this commit fixes NixOS#230146.
doronbehar
added a commit
to doronbehar/nixpkgs
that referenced
this issue
Jul 17, 2023
If one sets either of `override{Device,folder}s` to false, the jq `*` operator doesn't merge well the devices and folders, creating duplicate IDs for folders as observed in NixOS#230146. This PR makes the script iterate via a Bash for loop the devices and folders IDs and merges the keys using upstream's `curl -X PATCH` support for single objects. Hence this commit fixes NixOS#230146.
doronbehar
added a commit
to doronbehar/nixpkgs
that referenced
this issue
Jul 22, 2023
If one sets either of `override{Device,folder}s` to false, the jq `*` operator doesn't merge well the devices and folders, creating duplicate IDs for folders as observed in NixOS#230146. This PR makes the script iterate via a Bash for loop the devices and folders IDs and merges the keys using upstream's `curl -X PATCH` support for single objects. Hence this commit fixes NixOS#230146.
doronbehar
added a commit
to doronbehar/nixpkgs
that referenced
this issue
Jul 22, 2023
If one sets either of `override{Device,folder}s` to false, the jq `*` operator doesn't merge well the devices and folders, creating duplicate IDs for folders as observed in NixOS#230146. This PR makes the script iterate via a Bash for loop the devices and folders IDs and merges the keys using upstream's `curl -X PATCH` support for single objects. Hence this commit fixes NixOS#230146.
doronbehar
added a commit
to doronbehar/nixpkgs
that referenced
this issue
Jul 23, 2023
If one sets either of `override{Device,folder}s` to false, the jq `*` operator doesn't merge well the devices and folders, creating duplicate IDs for folders as observed in NixOS#230146. This PR makes the script iterate via a Bash for loop the devices and folders IDs and merges the keys using upstream's `curl -X PATCH` support for single objects. Hence this commit fixes NixOS#230146.
doronbehar
added a commit
to doronbehar/nixpkgs
that referenced
this issue
Jul 23, 2023
If one sets either of `override{Device,folder}s` to false, the jq `*` operator doesn't merge well the devices and folders, creating duplicate IDs for folders as observed in NixOS#230146. This PR makes the script iterate via a Bash for loop the devices and folders IDs and merges the keys using upstream's `curl -X PATCH` support for single objects. Hence this commit fixes NixOS#230146.
doronbehar
added a commit
to doronbehar/nixpkgs
that referenced
this issue
Jul 23, 2023
If one sets either of `override{Device,folder}s` to false, the jq `*` operator doesn't merge well the devices and folders, creating duplicate IDs for folders as observed in NixOS#230146. This PR makes the script iterate via a Bash for loop the devices and folders IDs and merges the keys using upstream's `curl -X PATCH` support for single objects. Hence this commit fixes NixOS#230146.
doronbehar
added a commit
to doronbehar/nixpkgs
that referenced
this issue
Jul 23, 2023
If one sets either of `override{Device,folder}s` to false, the jq `*` operator doesn't merge well the devices and folders, creating duplicate IDs for folders as observed in NixOS#230146. This PR makes the script iterate via Nix / Bash loop the devices and folders IDs and merges the keys using upstream's `curl -X POST` support for single objects. Hence this commit fixes NixOS#230146.
doronbehar
added a commit
to doronbehar/nixpkgs
that referenced
this issue
Jul 23, 2023
If one sets either of `override{Device,folder}s` to false, the jq `*` operator doesn't merge well the devices and folders, creating duplicate IDs for folders as observed in NixOS#230146. This PR makes the script iterate via a Bash for loop the devices and folders IDs and merges the keys using upstream's `curl -X PATCH` support for single objects. Hence this commit fixes NixOS#230146.
doronbehar
added a commit
to doronbehar/nixpkgs
that referenced
this issue
Jul 23, 2023
If one sets either of `override{Device,folder}s` to false, the jq `*` operator doesn't merge well the devices and folders, creating duplicate IDs for folders as observed in NixOS#230146. This PR makes the script iterate via a Bash for loop the devices and folders IDs and merges the keys using upstream's `curl -X PATCH` support for single objects. Hence this commit fixes NixOS#230146.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
I'm experiencing the issue for a long time now, and it was really hard to spot and debug this issue. I'm talking about this line:
nixpkgs/nixos/modules/services/networking/syncthing.nix
Line 59 in 3fbdad0
Steps To Reproduce
It's kind of hard to give instructions how to reproduce the issue. In my case, whenever the
merge-syncthing-config
dash script runs, every folder I already have configured, fails to update. The whole configuration thus fails to be uploaded to the server. I can inspect thenew_cfg
and theold_cfg
by editing that dash script, and I can see that I get folders twice in the json arrays. Hence I'm not surprised I see the following error in syncthing's web interface:Expected behavior
I expect the merge script to not
POST
a JSON array with no duplicate folders IDs.Proposed solution
Transition most of the logic from jq to bash, for easier maintenance, and use
/rest/config/folders
and/rest/config/devices
API, and use-X PATCH
whenoverrideFolders == false
.I'm working on a solution at the moment but I'd like to here your comments first.
Notify maintainers
cc @Lassulus who wrote the original dash script, other people have touched that line ever since, @raindev was the latest.
Metadata
The text was updated successfully, but these errors were encountered: