I am having issues getting rclone working with IBM Bluemix Swift. I have tried various combinations of configurations, but with no luck. I always get this message.
$: rclone lsd “SwiftBlueMix:” -vv
2017/10/27 08:13:50 DEBUG : Using config file from “/Users/mpcarl/.config/rclone/rclone.conf”
2017/10/27 08:13:50 DEBUG : rclone: Version “v1.38” starting with parameters [“rclone” “lsd” “SwiftBlueMix:” “-vv”]
2017/10/27 08:13:55 Failed to create file system for “SwiftBlueMix:”: Authorization Failed
The config is:
[SwiftBlueMix]
type = swift
user = [userId from credentials]
key = [password from credentials]
auth = https://identity.open.softlayer.com/v3
domain =
tenant = [projectId from credentails]
tenant_domain =
region = dallas
storage_url =
auth_version = 3
Using these values with the swift command line tool works correctly.
export OS_USER_ID= [userId from credentials]
export OS_PASSWORD= [password from credentials]
export OS_TENANT_ID=[projectId from credentails]
export OS_AUTH_URL=‘https://identity.open.softlayer.com/v3’
export OS_REGION_NAME=‘dallas’
export OS_IDENTITY_API_VERSION=3
export OS_AUTH_VERSION=3
$: swift list
DefaultProjectmpcarlusibmcom
fruit
usercontainer
With the Swift CLI tool I set OS_USER_ID. Using swift and rclone in the same shell gives:
[mpcarl] $: swift list
DefaultProjectmpcarlusibmcom
fruit
usercontainer
[mpcarl] $: rclone lsd "SwiftEnv:"
2017/10/29 19:56:57 Failed to create file system for "SwiftEnv:": user not found
If you use -vv --dump-bodies with rclone then you can see what rclone sends and compare the two. So set your env vars above and try rclone -vv --dump-bodies lsd "SwiftEnv:". I’d love to see what this says (but remove all your usernames and passwords!).
Looks like it immediately dumps the user not found error:
$: rclone lsd “SwiftEnv:” -vv --dump-bodies
2017/10/31 08:06:24 DEBUG : Using config file from “/Users/mpcarl/.config/rclone/rclone.conf”
2017/10/31 08:06:24 DEBUG : rclone: Version “v1.38” starting with parameters [“rclone” “lsd” “SwiftEnv:” “-vv” “–dump-bodies”]
2017/10/31 08:06:24 Failed to create file system for “SwiftEnv:”: user not found
If I instead use $OS_USERNAME, the request goes out and it looks to be the correct format. So it looks like the problem is that it won’t try with OS_USER_ID.
2017/10/31 08:07:35 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2017/10/31 08:07:35 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2017/10/31 08:07:35 DEBUG : HTTP RESPONSE (req 0xc420100000)
2017/10/31 08:07:35 DEBUG : HTTP/1.1 400 Bad Request
Content-Length: 233
Cache-Control: no-cache, no-store, must-revalidate
Cneonction: close
Content-Security-Policy: default-src 'self'
Content-Type: application/json
Date: Tue, 31 Oct 2017 13:07:33 GMT
Expires: 0
Pragma: no-cache
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5
Strict-Transport-Security: max-age=31536000
Vary: X-Auth-Token
X-Content-Type-Options: nosniff
X-Openstack-Request-Id: req-2659dac7-21ce-4610-9c39-c7548ae080a2
X-Xss-Protection: 0
{"error": {"message": "Expecting to find domain in user - the server could not comply with the request since it is either malformed or otherwise incorrect. The client is assumed to be in error.", "code": 400, "title": "Bad Request"}}
2017/10/31 08:07:35 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2017/10/31 08:07:35 Failed to create file system for "SwiftEnv:": Bad Request
Expecting to find domain in user - the server could not comply with the request since it is either malformed or otherwise incorrect. The client is assumed to be in error.
Which kind of suggests that if you were to supply the domain too it would work. Maybe!
[mpcarl] $: swift list
DefaultProjectmpcarlusibmcom
fruit
usercontainer
[mpcarl] $: rclone lsd "SwiftEnv:"
2017/10/31 11:41:56 Failed to create file system for "SwiftEnv:": user not found
[mpcarl] $: ~/Downloads/rclone-v1.38-050-g4a1013f2β-osx-amd64/rclone lsd "SwiftEnv:"
0 2017-10-31 11:42:24 0 DefaultProjectmpcarlusibmcom
7 2017-10-31 11:42:24 4 fruit
3621084 2017-10-31 11:42:24 4 usercontainer
I tried with different combinations of OS_DOMAIN, OS_DOMAIN_NAME, OS_DOMAIN_ID, etc. but never got that working. At any rate, this seems to work with with the same parameters as the Swift CLI.
I’d quite like to get a section on how to configure Bluemix into the docs.
If I add a “user_id” parameter to the swift config would you be willing to try to make a working config from it? That should be enough to make the config work without setting environment variables.
Absolutely! IBM Bluemix has four ObjectStorage options. With this fix, I’ll have three of them working. I have not tried the fourth option but will be getting to it shortly.
Perhaps it was picking it up from the ENV variable I had set based on it existing int he config? I was running in the same shell, so that might have confused things.
In a fresh shell, with tenant_id set in the rclone.conf file and no OS_ ENV values defined I don’t see it being passed in the request.
However, it still works. I don’t know if that means the project_id is optional or if I am just getting lucky because I only have one space defined in Bluemix.