/rest/db/file don't get file infos

Hi,

I try to get file info from /rest/db/file with this: http://127.0.0.1:8586/rest/db/file?folder=hitys-qk7th&file=data.txt

data.txt is at the root of the folder, but I always get an error 404. I try with some other folder and file, always the same :confused:

I use v1.7.1

I’ve tried completion of a folder, ping, ect… everything works fine

thanks

You might need to prefix it with a slash. Also, the port looks suspicious.

The port is normal, I change it at startup for testing purpose. I’ve tried that: http://127.0.0.1:8586/rest/db/file?folder=hitys-qk7th&file=/data.txt without luke :confused:

Hard to say, your example works for me in 1.7.1. Without slash. (With API-key.) With the ampersand escaped, as I’m using curl in a shell.

I’m very confused… I just try with shell:

same, 404 error… the folder param is the good ID, the file is in the folder…

You need to quote the URL. & has a special meaning if not quoted.

Same result…

In shell, everything I try with DB got 404 error, I just try a ping and that work well, I try completion, and I got 404 error in the shell and good result in my script

Does it still print “file” command not found?

Nope, when quoted no other message than 404 page not found was shown

Do you have a reverse proxy or something? Because its not the standard port.

No, I just set another port at startup (-gui-adress=127.0.0.1:8586) but I set the default port and test again, same result:

Ok, ping works because POST and GET do the same, I set POST and note GET in the shell, so, ping works and other command who only GET things not works… So, completion works now in shell, but I got “No such object in the index” when try /rest/db/file… that look to be a step! I always get error 404 in my script, and the method was set to GET from the beginning, so it’s not the problem here.

Yeah I was just going to say, these are not POST endpoints.

% curl -H X-API-Key:abc123 "http://localhost:8082/rest/db/file?folder=default&file=data.txt"
{
  "availability": null,
  "global": {
    "deleted": false,
  ...

% curl -sH X-API-Key:abc123 "http://localhost:8082/rest/system/version" | grep version
  "version": "v1.7.1"

Yeah, but that not works, even in my script where POST is set from the beginning. Now in shell I have another error: “No such object in the index”

I feel like I miss something…

The index paths are case sensitive too

What is the index?

The file part of the url is what gets stored in the index.

Ok, I found why that not works from the beginning (after recreating the sharing folder - before, same result has before): the folder have to be unpause…

So, it’s not possible to know if a folder have to be updated without try to update it?

I mean, the device is unpaused, but all folder are paused, the fact that the device is unpause is not enough to get information about folders?

No, a paused folder pretty much does not exist in syncthing.

Just to be sure, I have no choice, if I want to pause just the download, I have to pause the folder and lost all access to information about it?