# Can't write object storage

**URL:** <https://forum.heroiclabs.com/t/cant-write-object-storage/4214>\
**Category:** Runtime Framework\
**Created:** [August 10, 2023, 3:14am UTC](https://forum.heroiclabs.com/t/cant-write-object-storage/4214 "2023-08-10T03:14:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![headria](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/headria/32/1745_2.png) [@headria](https://forum.heroiclabs.com/u/headria)\
**Post date:** [August 10, 2023, 3:14am UTC](https://forum.heroiclabs.com/t/cant-write-object-storage/4214/1 "2023-08-10T03:14:49Z")

</div>

I’m attempting to write to the storage, but consistently encounter the following error:  
“rpc error: code = Internal desc = Error writing storage objects.”

Here’s the code I’ve been using:

```json
{
  "objects": [
    {
      "collection": "P",
      "key": "p2",
      "value": "{\n \"address\": \"1\"\n}",
      "permissionRead": 1,
      "permissionWrite": 0
    }
  ]
}

```

However, when I append `version:"*"` to the code, the write operation succeeds. Yet, this introduces a new problem. When I try to read from the database, the server throws the following error:  
“Could not read storage objects.”,“error”:“cannot convert [p] to Text”

Any insights on resolving this would be much appreciated.

---

<div class="post-metadata">

**Author:** ![sesposito](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/sesposito/32/2594_2.png) [@sesposito](https://forum.heroiclabs.com/u/sesposito)\
**Post date:** [August 11, 2023, 10:19am UTC](https://forum.heroiclabs.com/t/cant-write-object-storage/4214/2 "2023-08-11T10:19:07Z")

</div>

Hello @headria,

Could you please share which version of the server you’re using?

It would also help if you could provide your custom RPC code.

---

<div class="post-metadata">

**Author:** ![headria](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/headria/32/1745_2.png) [@headria](https://forum.heroiclabs.com/u/headria)\
**Post date:** [August 11, 2023, 11:50am UTC](https://forum.heroiclabs.com/t/cant-write-object-storage/4214/3 "2023-08-11T11:50:50Z")

</div>

I changed the database from CockroachDB to PostgreSQL, and the problem was solved

---

<div class="post-metadata">

**Author:** ![sesposito](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/sesposito/32/2594_2.png) [@sesposito](https://forum.heroiclabs.com/u/sesposito)\
**Post date:** [August 11, 2023, 12:42pm UTC](https://forum.heroiclabs.com/t/cant-write-object-storage/4214/4 "2023-08-11T12:42:01Z")

</div>

I see, I believe this is an issue related to a bug in CRDB, make sure you’re using the latest CRDB version and it should resolve itself, we’ve recently upgraded the version in the docker-compose files on master to address it.
