# Could not read storage objects on first read of collection

**URL:** <https://forum.heroiclabs.com/t/could-not-read-storage-objects-on-first-read-of-collection/4238>\
**Category:** Runtime Framework\
**Tags:** server-framework, golang\
**Created:** [August 14, 2023, 9:46pm UTC](https://forum.heroiclabs.com/t/could-not-read-storage-objects-on-first-read-of-collection/4238 "2023-08-14T21:46:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ADustyOldMuffin](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/adustyoldmuffin/32/1768_2.png) [@ADustyOldMuffin](https://forum.heroiclabs.com/u/ADustyOldMuffin)\
**Post date:** [August 14, 2023, 9:46pm UTC](https://forum.heroiclabs.com/t/could-not-read-storage-objects-on-first-read-of-collection/4238/1 "2023-08-14T21:46:04Z")

</div>

So I’m trying to read from the storage engine

```auto
data, err := nm.StorageRead(ctx, []*runtime.StorageRead{{
	Collection: "user_data",
	Key: "myKey",
	UserID: userId,
}})

```

Where the userID is fetched further up via the context in an RPC call. However I get an error when doing this, and it is of note that I have nothing in any collection currently.

1. Versions: nakama:3.17.0 docker image, CockroachDB image tag: latest-v20.2
2. Server Framework Runtime language (If relevant) Go

Logs

```auto
servermodules-nakama-1 | {"level":"error","ts":"2023-08-14T21:39:21.262Z","caller":"server/core_storage.go:494","msg":"Could not read storage objects.","error":"cannot convert [user_data] to Text"}

```

I looked at the source and I’m guessing this is from reading the rows? I’m not quite sure as all tutorials don’t show initializing collections, and read exactly the way I am here. Not quite sure what’s going on.

---

<div class="post-metadata">

**Author:** ![ADustyOldMuffin](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/adustyoldmuffin/32/1768_2.png) [@ADustyOldMuffin](https://forum.heroiclabs.com/u/ADustyOldMuffin)\
**Post date:** [August 14, 2023, 9:58pm UTC](https://forum.heroiclabs.com/t/could-not-read-storage-objects-on-first-read-of-collection/4238/2 "2023-08-14T21:58:01Z")

</div>

I’ll beat you all to it and answer my own question, the issue I guess is a bug in CRDB and the docker-compose image tag is real old.

> [@Can't write object storage](https://forum.heroiclabs.com/t/cant-write-object-storage/4214):
>
> 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: { "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 re…

I went from v20.2 → v22.2 and it fixed it.
