ERROR : rc: "config/create": error: Didn't find key "parameters" in input

I have rclone: Version "v1.49.1" runing on windows 10

I am trying to run this command
rclone rc --rc-addr=IP:5572 --rc-user=<user> --rc-pass=<pass> config/create name=testswift type=swift

It says

     Failed to rc: Failed to read rc response: 400 Bad Request: {
            "error": "Didn't find key \"parameters\" in input",
            "input": {
                    "name": "testswift",
                    "type": "swift"
            },
            "path": "config/create",
            "status": 400
    }

In the remote side in which I run rclone rcd the ERROR is saying:
ERROR : rc: "config/create": error: Didn't find key "parameters" in input

what is the parameters and how I should define it for swift connection.

I also tried rclone rc --rc-addr=IP:5572 --rc-user=<user> --rc-pass=<pass> config/create name=testswift type=swift parameters={"aut_version":"1",user:<my-swift-user>}

this time it says rc: "config/create": error: key "parameters": Reshape failed to Unmarshal: json: cannot unmarshal string into Go value of type rc.Params

Looking at documentation and google I could not find any article or discussion around rclone rc config/create.

Any help would be appreciated

https://rclone.org/commands/rclone_config_create/

The doc example given is actually for swift, so that should help:

For example to make a swift remote of name myremote using auto config you would do:

rclone config create myremote swift env_auth true

I note that there is a third argument there "env_auth true" and specifying that may be a required minimum for configuring a swift remote. That could be why it is complaining about missing parameters.

I don't have experience with swift though. This is just going by reading the docs.
You are doing it through the RC which means the syntaxt may be slightly different, but it should be fairly obvious how to alter it, and the structure of the command should be the same regardless.

Thanks thestigma

What you said is the syntax when using rclone.

But withrclone rc the syntax is different. according to https://rclone.org/rc/
the syntax is:
config/create: create the config for a remote.
This takes the following parameters
name - name of remote
type - type of the new remote

I need to now how to define the parameters so it can be unmarshalized correctly? :frowning:

looking at the error u can see it is looking for key 'parameters in input dictionary. when I created parameters key now it complains about failing to unmarshal string to rc.Params.

Slightly different syntax yes, but the structure should be the same. The RC documentation even links you to the documentation for the regular rclone command.

I'd just do exactly what the example suggests and see if that works first of all, so for the RC that would be:
rclone rc --rc-addr=IP:5572 --rc-user= --rc-pass= config/create name=testswift type=swift env_auth=true

I'd just give that a go and see if it works for you

env auth seems to refer to this:

Configuration from the environment

If you prefer you can configure rclone to use swift using a standard set of OpenStack environment variables.

When you run through the config, make sure you choose true for env_auth and leave everything else blank.

rclone will then set any empty config parameters from the environment using standard OpenStack environment variables. There is a list of the variables in the docs for the swift library.

So it would seem logical to me that you may be required to use this unless you specify all the other parameters, otherwise it won't have the minimum information it needs to make the config.

I tried it it complains about missing key called 'parameters'. Also I tried just simply creating local remote. Asking for parameters. when I add parameters=something. the error changes to

failing to unmarshal string to rc.Params

Ok, then I think I probably need to try it with my own rc at home to see what is expects. Unfortunately don't have access to that right now, but unless someone else chimes in with the solution by tomorrow I should be able to get back to you on this.

The parameters needs to be a JSON blob. The best thing is to define the whole input as JSON so something like

rclone rc --json '{"name": "testswift", "type": "swift", "parameters": {"env_auth": true}}' config/create

The docs for config/create are severely lacking I see as they don't mention the parameters at all!

1 Like

I fixed the docs for config/create - they will go up next update of the website.

1 Like

Thanks a lot for the reply but this time it throws another error.

Failed to rc: can't use --json and parameters together

Is this a bug in rclone RC ?

I think you'll have to do the complete request as JSON - see my example above.

Yes I passed exactly the same command as you recommend. Have you tried this on your computer. Is it working for you?
Thanks

Yes it works for me on my linux computer. If you are using Windows you will need to adjust the quoting as I don't think Windows understands single quotes...

1 Like

Thanks a lot as you said it works on linux. I could run it on my windows as well :smiley:. I just changed single to double quote and escaped inner double quotes to make it work on windows.

 rclone rc --json "{\"name\": \"testswift3\", \"type\": \"swift\", \"parameters\": {\"env_auth\": true}}" config/create --rc-addr=ip:port --rc-user=myuser --rc-pass=mypass
1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.