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.
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 find({_ id: '12fb71bc- 4e18-47f8- 898d-ab608eefcc 41:resource# neutron- api/policyd- override# charmstore' }) _id='12fb71bc- 4e18-47f8- 898d-ab608eefcc 41:resource# neutron- api/policyd- override' insert( new_doc)
```
var new_doc = db.resources.
new_doc.
db.resources.
juju attach-resource neutron-api policyd- override= create- port-binding- profile- override. zip --debug --verbose a37f9b7c3b5c31b dcb1dad333 gc go1.20.5] "/snap/ juju/23558/ bin/juju" , "attach-resource", "neutron-api", "policyd- override= create- port-binding- profile- override. zip", "--debug", "--verbose"} x.x.x.x: 17070/model/ 12fb71bc- 4e18-47f8- 898d-ab608eefcc 41/api" x.x.x.x: 17070/model/ 12fb71bc- 4e18-47f8- 898d-ab608eefcc 41/api" /x.x.x. x:17070/ model/12fb71bc- 4e18-47f8- 898d-ab608eefcc 41/applications /neutron- api/resources/ policyd- override: got invalid data from DB: unsupported resource type "" snapcraft- juju-b12ec14ae8 781cd65bb197dc2 7b9cc5f/ parts/juju/ build/vendor/ gopkg.in/ httprequest. v1/client. go:307: Put https:/ /x.x.x. x:17070/ model/12fb71bc- 4e18-47f8- 898d-ab608eefcc 41/applications /neutron- api/resources/ policyd- override snapcraft- juju-b12ec14ae8 781cd65bb197dc2 7b9cc5f/ parts/juju/ build/vendor/ gopkg.in/ httprequest. v1/client. go:185: com/juju/ juju/api/ client/ resources. Client. Upload: 118: com/juju/ juju/cmd/ juju/resource. (*UploadCommand ).upload: 155: com/juju/ juju/cmd/ juju/resource. (*UploadCommand ).Run:140: failed to upload resource "policyd-override"
08:56:40 INFO juju.cmd supercommand.go:56 running juju [2.9.44 02d498631e196f2
08:56:40 DEBUG juju.cmd supercommand.go:57 args: []string{
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://
08:56:40 INFO juju.api apiclient.go:687 connection established to "wss://
08:56:40 DEBUG juju.api monitor.go:35 RPC connection died
ERROR failed to upload resource "policyd-override": Put https:/
08:56:40 DEBUG cmd supercommand.go:537 error stack:
got invalid data from DB: unsupported resource type ""
/build/
/build/
github.
github.
github.
```
I've upgraded juju controller and model to 2.9.44, rolledback the workaround and the resource was successfully attached.
``` deleteOne( {_id: '12fb71bc- 4e18-47f8- 898d-ab608eefcc 41:resource# neutron- api/policyd- override' })
db.resources.
$ juju attach-resource neutron-api policyd- override= policyd- override. zip
```