Invalid memory address or nil pointer during init of OpenStack Swift

When runnig duplicacy init -e test "swift://SBI-XXXXXX@swiss-backup.infomaniak.com/identity/v3?domain=default&tenant=sb_project_XXXXXX" I’m asked to enter the OpenStack Swift key, and after doing so the result is:

runtime error: invalid memory address or nil pointer dereference                                                                                             
goroutine 1 [running]:                                                                                                                                       
runtime/debug.Stack(0x41, 0x0, 0x0)                                                                                                                          
        /usr/local/go/src/runtime/debug/stack.go:24 +0xa4                                                                                                    
runtime/debug.PrintStack()                                                                                                                                   
        /usr/local/go/src/runtime/debug/stack.go:16 +0x29                                                                                                    
github.com/gilbertchen/duplicacy/src.CatchLogException()                                                                                                     
        /Users/chgang/zincbox/go/src/github.com/gilbertchen/duplicacy/src/duplicacy_log.go:224 +0xf5                                                         
panic(0xea0fe0, 0x1a5b4c0)                                                                                                                                   
        /usr/local/go/src/runtime/panic.go:522 +0x1c3                                                                                                        
sync.(*Mutex).Lock(0x0)                                                                                                                                      
        /usr/local/go/src/sync/mutex.go:74 +0x34                                                                                                             
github.com/gilbertchen/duplicacy/vendor/github.com/ncw/swift.(*Connection).storage(0xc0003f0000, 0x0, 0x0, 0x0, 0x0, 0xfdc37f, 0x4, 0x0, 0x0, 0xc0003be000, .
..)                                                                                                                                                          
        /Users/chgang/zincbox/go/src/github.com/gilbertchen/duplicacy/vendor/github.com/ncw/swift/swift.go:816 +0x86                                         
github.com/gilbertchen/duplicacy/vendor/github.com/ncw/swift.(*Connection).Container(0xc0003f0000, 0x0, 0x0, 0x8, 0x1a90be0, 0xc000078085, 0x2b, 0xc000142e80
, 0x33, 0x45f9a0)                                                                                                                                            
        /Users/chgang/zincbox/go/src/github.com/gilbertchen/duplicacy/vendor/github.com/ncw/swift/swift.go:1308 +0xde                                        
github.com/gilbertchen/duplicacy/src.CreateSwiftStorage(0xc000078078, 0x38, 0xc0003bc270, 0x8, 0x1, 0x0, 0xc000078070, 0x6e)                                 
        /Users/chgang/zincbox/go/src/github.com/gilbertchen/duplicacy/src/duplicacy_swiftstorage.go:132 +0x994                                               
github.com/gilbertchen/duplicacy/src.CreateStorage(0xfdf358, 0x7, 0xc00002a0f8, 0x4, 0x0, 0x0, 0xc000078070, 0x6e, 0x1, 0x0, ...)                            
        /Users/chgang/zincbox/go/src/github.com/gilbertchen/duplicacy/src/duplicacy_storage.go:671 +0x4700                                                   
main.configRepository(0xc0003b85a0, 0xc0003b8501)                                                                                                            
        /Users/chgang/zincbox/go/src/github.com/gilbertchen/duplicacy/duplicacy/duplicacy_main.go:337 +0x6d7                                                 
main.initRepository(0xc0003b85a0)                                                                                                                            
        /Users/chgang/zincbox/go/src/github.com/gilbertchen/duplicacy/duplicacy/duplicacy_main.go:232 +0x37                                                  
github.com/gilbertchen/duplicacy/vendor/github.com/gilbertchen/cli.Command.Run(0xfdc76b, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x101c925, 0x4f, 0x0, ...)            
        /Users/chgang/zincbox/go/src/github.com/gilbertchen/duplicacy/vendor/github.com/gilbertchen/cli/command.go:160 +0x754                                
github.com/gilbertchen/duplicacy/vendor/github.com/gilbertchen/cli.(*App).Run(0xc0003b8120, 0xc00003c080, 0x5, 0x8, 0x0, 0x0)                                
        /Users/chgang/zincbox/go/src/github.com/gilbertchen/duplicacy/vendor/github.com/gilbertchen/cli/app.go:179 +0x656                                    
main.main()                                                                                                                                                  
        /Users/chgang/zincbox/go/src/github.com/gilbertchen/duplicacy/duplicacy/duplicacy_main.go:2129 +0x614e      

This is using version 2.6.2 och duplicacy CLI on Windows. Does not appear to matter much what I write after the swift:// protocol specifier, the result always appears to be a nil pointer dereference error. :frowning:

The container path is missing from the url. Ideally it should be after /v3.

Forgive me if I’m being stupid here, but I’m not sure what the “container path” would be? Whatever I add there gives me the same “invalid memory address” error.

The following is what I have in my rclone config, which works to connect to this service:

[swiss]
type = swift
user = SBI-XXXXXX
key = SECRET
auth = https://swiss-backup.infomaniak.com/identity/v3
domain = default
tenant = sb_project_SBI-XXXXXX
tenant_domain = default
region = RegionOne
storage_url =
auth_version = 3

I’m really not sure what I’m doing wrong here. Any suggestions are more than welcome. :slight_smile:

My understanding is that a container in OpenStack Swift is like a bucket in S3. I didn’t know you can omit the container…

Well, the information above is all I was given, and can use to successfully connect via rclone or CyberDuck, so if I’m not doing something else wrong in specifying the storage url to duplicacy, there must be some kind of bug there? (As a developer I would argue that any nil reference error is actually a bug, but that’s just me :wink: )

Should I create a bug in GitHub for this issue, or is this post sufficient? Can I be of any more assistance in solving this problem somehow?

P.S. There is a free 90 day trial available at the provider I’m having problems with if you need somewhere to test against. See https://www.infomaniak.com/en/swiss-backup

You might be able to connect, but have you done anything with it? As per Rclone docs, it sounds like you have to create a container to work from it:

See all containers

rclone lsd remote:

Make a new container

rclone mkdir remote:container

Presumably you can also create containers through the provider’s dashboard.

Yes, I exposed it as sftp and was able to connect to the sftp and upload and download files from it. There might be that there is a container named “default”. But appending that to the url in duplicacy gives me the same error.

What does rclone lsd remote: say? It could be that Rclone picks the first container and uses it as default.

I can confirm that the container should be default. However, the bug isn’t caused by the missing container but rather a change in the underlying library github.com/ncw/swift. I’ll fix it in the next release.

2 Likes