# Environment variable config not used for remote control

**URL:** <https://forum.rclone.org/t/environment-variable-config-not-used-for-remote-control/39014>\
**Category:** Suspected Bug\
**Created:** [June 14, 2023, 8:34am UTC](https://forum.rclone.org/t/environment-variable-config-not-used-for-remote-control/39014 "2023-06-14T08:34:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![baurmatt](https://forum.rclone.org/user_avatar/forum.rclone.org/baurmatt/32/14259_2.png) [@baurmatt](https://forum.rclone.org/u/baurmatt)\
**Post date:** [June 14, 2023, 8:34am UTC](https://forum.rclone.org/t/environment-variable-config-not-used-for-remote-control/39014/1 "2023-06-14T08:34:21Z")

</div>

#### What is the problem you are having with rclone?

Configuring an instance of remote control instance of rclone with environment variables doesn't expose those variables in RC.

#### Run the command 'rclone version' and share the full output of the command.

```auto
$ rclone version
rclone v1.62.2
- os/version: darwin 13.3.1 (64 bit)
- os/kernel: 22.4.0 (arm64)
- os/type: darwin
- os/arch: arm64 (ARMv8 compatible)
- go/version: go1.20.2
- go/linking: dynamic
- go/tags: none

```

#### Which cloud storage system are you using? (eg Google Drive)

S3 (based on Ceph)

#### The command you were trying to run (eg `rclone copy /tmp remote:tmp`)

```auto
export RCLONE_CONFIG_CEPH_ACCESS_KEY_ID=xxxxxxxxxxxxx
export RCLONE_CONFIG_CEPH_SECRET_ACCESS_KEY=yyyyyyyyyyyyyy
export RCLONE_CONFIG_CEPH_TYPE=s3
export RCLONE_CONFIG_CEPH_ENDPOINT=https://myobjectstorage.example.org
export RCLONE_CONFIG_CEPH_PROVIDER=Other
export RCLONE_CONFIG_CEPH_ACL=private
rclone rcd --rc-user foo --rc-pass bar

```

```auto
$ rclone rc --user foo --pass bar config/listremotes
{
	"remotes": []
}

```

#### The rclone config contents with secrets removed.

```auto
export RCLONE_CONFIG_CEPH_ACCESS_KEY_ID=xxxxxxxxxxxxx
export RCLONE_CONFIG_CEPH_SECRET_ACCESS_KEY=yyyyyyyyyyyyyy
export RCLONE_CONFIG_CEPH_TYPE=s3
export RCLONE_CONFIG_CEPH_ENDPOINT=https://myobjectstorage.example.org
export RCLONE_CONFIG_CEPH_PROVIDER=Other
export RCLONE_CONFIG_CEPH_ACL=private

```

#### A log from the command with the `-vv` flag

```auto
$ rclone -vv rcd --rc-user foo --rc-pass bar
2023/06/14 10:32:19 DEBUG : rclone: Version "v1.62.2" starting with parameters ["rclone" "-vv" "rcd" "--rc-user" "foo" "--rc-pass" "bar"]
2023/06/14 10:32:19 INFO : Using --user foo --pass XXXX as authenticated user
2023/06/14 10:32:19 NOTICE: Serving remote control on http://127.0.0.1:5572/
2023/06/14 10:32:21 DEBUG : rc: "config/listremotes": with parameters map[]
2023/06/14 10:32:21 NOTICE: Config file "/Users/mbaur/.config/rclone/rclone.conf" not found - using defaults
2023/06/14 10:32:21 DEBUG : rc: "config/listremotes": reply map[remotes:[]]: <nil>
2023/06/14 10:32:25 DEBUG : rc: "config/listremotes": with parameters map[]
2023/06/14 10:32:25 DEBUG : rc: "config/listremotes": reply map[remotes:[]]: <nil>

```

```auto
$ rclone -vv rc --user foo --pass bar config/listremotes
2023/06/14 10:32:25 DEBUG : rclone: Version "v1.62.2" starting with parameters ["rclone" "-vv" "rc" "--user" "foo" "--pass" "bar" "config/listremotes"]
{
	"remotes": []
}
2023/06/14 10:32:25 DEBUG : 6 go routines active

```

---

<div class="post-metadata">

**Author:** ![ncw](https://forum.rclone.org/user_avatar/forum.rclone.org/ncw/32/18_2.png) [@ncw](https://forum.rclone.org/u/ncw)\
**Post date:** [June 14, 2023, 2:10pm UTC](https://forum.rclone.org/t/environment-variable-config-not-used-for-remote-control/39014/2 "2023-06-14T14:10:09Z")

</div>

> [@baurmatt](#):
>
> Configuring an instance of remote control instance of rclone with environment variables doesn't expose those variables in RC.

It doesn't expose them in `rclone listremotes` is the root of the problem.

I think there is an issue about that somewhere.

> <https://github.com/rclone/rclone/issues/6540>
>
> \#### The associated forum post URL from \`https://forum.rclone.org\`
> 
> I have not… found any mention of that issue on the forum, or on existing issues
> 
> \#### What is the problem you are having with rclone?
> 
> I'm using \`rclone rcd\` on a kubernetes cluster to move my backups around and out of the cluster.
> 
> The rclone rcd have the following env vars:
> \`\`\`
> env | grep RCLONE\_CONFIG
> RCLONE\_CONFIG\_INTERNAL\_PROVIDER=Minio
> RCLONE\_CONFIG\_INTERNAL\_TYPE=s3
> RCLONE\_CONFIG\_INTERNAL\_ACCESS\_KEY\_ID=bH0t8Cb4b8UrPpXV
> RCLONE\_CONFIG\_INTERNAL\_SECRET\_ACCESS\_KEY=GMBGlXPVsLzCzzQnohBL86Il
> RCLONE\_CONFIG\_INTERNAL\_ENDPOINT=https://minio.foundation
> \`\`\`
> \> Those are temporary credentials, this is not a leak :)
> 
> Despite the variables being defined correctly running \`rclone rc config/listremotes\` returns an empty array.
> 
> If I use \`--rc-serve\`, the remote is correctly listed and working.
> If I try to access the remote using \`operations/list\` it works correctly.
> 
> I've found this extremely confusing and spent a few hours trying to debug something that was actually working.
> 
> It seems the function \`config.FileSections()\` is not called when the \`listremotes\` operation is called via rc.
> 
> So essentially my question is: is it a bug or a feature ?If this is expected behavior, I'd like to see something added in the doc to save the next fellow the few hours I've lost. If this is a bug, let's try to fix it ?
> 
> \#### What is your rclone version (output from \`rclone version\`)
> 
> \`\`\`
> rclone v1.60.0
> \- os/version: alpine 3.16.2 (64 bit)
> \- os/kernel: 5.4.0-122-generic (x86\_64)
> \- os/type: linux
> \- os/arch: amd64
> \- go/version: go1.19.2
> \- go/linking: static
> \- go/tags: none
> \`\`\`
> 
> \#### Which OS you are using and how many bits (e.g. Windows 7, 64 bit)
> 
> The official rclone docker image
> 
> \#### Which cloud storage system are you using? (e.g. Google Drive)
> 
> S3, but probably irrelevant here
> 
> 
> 
> 
> \#### How to use GitHub
> 
> \* Please use the 👍 \[reaction\](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to show that you are affected by the same issue.
> \* Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
> \* Subscribe to receive notifications on status change and new comments.

It would be relatively easy to fix - list remotes would just have to look for env vars named `RCLONE_CONFIG_*_TYPE` and list them as part of listremotes.

Do you want to have a go at that?

---

<div class="post-metadata">

**Author:** ![kapitainsky](https://forum.rclone.org/user_avatar/forum.rclone.org/kapitainsky/32/14450_2.png) [@kapitainsky](https://forum.rclone.org/u/kapitainsky)\
**Post date:** [June 14, 2023, 3:02pm UTC](https://forum.rclone.org/t/environment-variable-config-not-used-for-remote-control/39014/3 "2023-06-14T15:02:58Z")

</div>

I have tried as I need it too:). PR sent.

> <https://github.com/rclone/rclone/pull/7057>
>
> Fixes: 
> \#6540
> 
> Discussed:
> https://forum.rclone.org/t/environment-variable-co…nfig-not-used-for-remote-control/39014

---

<div class="post-metadata">

**Author:** ![system](https://forum.rclone.org/uploads/default/original/2X/3/39ad3235f6ffec76ccd0c81616bd55697b4c300d.png) [@system](https://forum.rclone.org/u/system)\
**Post date:** [July 14, 2023, 3:03pm UTC](https://forum.rclone.org/t/environment-variable-config-not-used-for-remote-control/39014/4 "2023-07-14T15:03:38Z")

</div>

Closed on July 14, 2023, 3:03pm UTC

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