Comment 16 for bug 1979981

Revision history for this message
Gui Maluf Balzana (guimalufb) wrote :

I faced the same issue on the same cloud as reported by @peter-sabaini, but in a charm without previous attached resource.

The workaround didn't work, as it throw a distinct issue
```
var new_doc = db.resources.find({_id: '12fb71bc-4e18-47f8-898d-ab608eefcc41:resource#neutron-api/policyd-override#charmstore'})
new_doc._id='12fb71bc-4e18-47f8-898d-ab608eefcc41:resource#neutron-api/policyd-override'
db.resources.insert(new_doc)

juju attach-resource neutron-api policyd-override=create-port-binding-profile-override.zip --debug --verbose
08:56:40 INFO juju.cmd supercommand.go:56 running juju [2.9.44 02d498631e196f2a37f9b7c3b5c31bdcb1dad333 gc go1.20.5]
08:56:40 DEBUG juju.cmd supercommand.go:57 args: []string{"/snap/juju/23558/bin/juju", "attach-resource", "neutron-api", "policyd-override=create-port-binding-profile-override.zip", "--debug", "--verbose"}
08:56:40 INFO juju.juju api.go:86 connecting to API addresses: [x.x.x.x:17070 x.x.x.x:17070 x.x.x.x:17070]
08:56:40 DEBUG juju.api apiclient.go:1152 successfully dialed "wss://x.x.x.x:17070/model/12fb71bc-4e18-47f8-898d-ab608eefcc41/api"
08:56:40 INFO juju.api apiclient.go:687 connection established to "wss://x.x.x.x:17070/model/12fb71bc-4e18-47f8-898d-ab608eefcc41/api"
08:56:40 DEBUG juju.api monitor.go:35 RPC connection died
ERROR failed to upload resource "policyd-override": Put https://x.x.x.x:17070/model/12fb71bc-4e18-47f8-898d-ab608eefcc41/applications/neutron-api/resources/policyd-override: got invalid data from DB: unsupported resource type ""
08:56:40 DEBUG cmd supercommand.go:537 error stack:
got invalid data from DB: unsupported resource type ""
/build/snapcraft-juju-b12ec14ae8781cd65bb197dc27b9cc5f/parts/juju/build/vendor/gopkg.in/httprequest.v1/client.go:307: Put https://x.x.x.x:17070/model/12fb71bc-4e18-47f8-898d-ab608eefcc41/applications/neutron-api/resources/policyd-override
/build/snapcraft-juju-b12ec14ae8781cd65bb197dc27b9cc5f/parts/juju/build/vendor/gopkg.in/httprequest.v1/client.go:185:
github.com/juju/juju/api/client/resources.Client.Upload:118:
github.com/juju/juju/cmd/juju/resource.(*UploadCommand).upload:155:
github.com/juju/juju/cmd/juju/resource.(*UploadCommand).Run:140: failed to upload resource "policyd-override"
```

I've upgraded juju controller and model to 2.9.44, rolledback the workaround and the resource was successfully attached.

```
db.resources.deleteOne({_id: '12fb71bc-4e18-47f8-898d-ab608eefcc41:resource#neutron-api/policyd-override'})

$ juju attach-resource neutron-api policyd-override=policyd-override.zip
```