# DROP BLOB TABLE error

**URL:** <https://community.cratedb.com/t/drop-blob-table-error/1106>\
**Category:** CrateDB\
**Created:** [May 17, 2022, 1:04pm UTC](https://community.cratedb.com/t/drop-blob-table-error/1106 "2022-05-17T13:04:54Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![rps-v](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/rps-v/32/342_2.png) [@rps-v](https://community.cratedb.com/u/rps-v)\
**Post date:** [May 17, 2022, 1:04pm UTC](https://community.cratedb.com/t/drop-blob-table-error/1106/1 "2022-05-17T13:04:54Z")

</div>

When trying to DROP a blob table (v 4.2.6) I receive the following error:

```auto
SQLActionException[ClusterBlockException: blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];]

```

Already tried the following without success:

```auto
DROP TABLE "blob"."mytable"
DROP BLOB TABLE "blob"."mytable"

```

Also tried modifying settings:

```auto
ALTER TABLE "blob"."document" SET ("blocks.read_only_allow_delete" = FALSE)
ALTER BLOB TABLE "blob"."document" SET ("blocks.read_only_allow_delete" = FALSE)

```

But get errors:

```auto
SQLActionException[OperationOnInaccessibleRelationException: The relation "blob.mytable" doesn't support or allow ALTER operations.]
or
SQLActionException[SQLParseException: Invalid property "blocks.read_only_allow_delete" passed to [ALTER | CREATE] TABLE statement]

```

---

<div class="post-metadata">

**Author:** ![jayeff](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/jayeff/32/271_2.png) [@jayeff](https://community.cratedb.com/u/jayeff)\
**Post date:** [May 17, 2022, 4:49pm UTC](https://community.cratedb.com/t/drop-blob-table-error/1106/3 "2022-05-17T16:49:15Z")

</div>

Hi @rps-v,

seems you found a bug 🐞 (congrats 😅). Unfortunately it seems there is not really a workaround for this either 😔

Can you [open an issue on crate/crate](https://github.com/crate/crate/issues/new?assignees=&labels=triage&template=bug.yml) for this?

If you do not have a GitHub account let me know and I can create the issue for you

Thanks

---

<div class="post-metadata">

**Author:** ![rps-v](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/rps-v/32/342_2.png) [@rps-v](https://community.cratedb.com/u/rps-v)\
**Post date:** [May 19, 2022, 5:08am UTC](https://community.cratedb.com/t/drop-blob-table-error/1106/4 "2022-05-19T05:08:49Z")

</div>

> [@rps-v](#):
>
> ```auto
> SQLActionException[SQLParseException: Invalid property "blocks.read_only_allow_delete" passed to [ALTER | CREATE] TABLE statement]
> 
> ```

I created an issue on GitHub : [Cannot DROP BLOB TABLE · Issue #12534 · crate/crate · GitHub](https://github.com/crate/crate/issues/12534)

---

<div class="post-metadata">

**Author:** ![jayeff](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/jayeff/32/271_2.png) [@jayeff](https://community.cratedb.com/u/jayeff)\
**Post date:** [May 24, 2022, 8:26am UTC](https://community.cratedb.com/t/drop-blob-table-error/1106/5 "2022-05-24T08:26:15Z")

</div>

Hi @rps-v,

quick update: a PR to fix this was merged yesterday

> <https://github.com/crate/crate/pull/12547>
>
> This enables to alter the setting \`\`blocks.read\_only\_allow\_delete\`\` on blob
> tab…les to make it possible to drop read-only blob tables.
> 
> Resolves https://github.com/crate/crate/issues/12534
> 
> \## Summary of the changes / Why this improves CrateDB
> 
> 
> \## Checklist
> 
> - \[x\] Added an entry in \`CHANGES.txt\` for user facing changes
> - \[x\] Updated documentation & \`sql\_features\` table for user facing changes
> - \[x\] Touched code is covered by tests
> - \[x\] \[CLA\](https://crate.io/community/contribute/cla/) is signed
> - \[x\] This does not contain breaking changes, or if it does:
> - It is released within a major release
> - It is recorded in \`\`CHANGES.txt\`\`
> - It was marked as deprecated in an earlier release if possible
> - You've thought about the consequences and other components are adapted
> (E.g. AdminUI)

It was backported to CrateDB 4.7 and CrateDB 4.8 and will be updated with the next patch release. I expect that a testing release will land in a couple days.

---

<div class="post-metadata">

**Author:** ![rps-v](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/rps-v/32/342_2.png) [@rps-v](https://community.cratedb.com/u/rps-v)\
**Post date:** [May 24, 2022, 9:23am UTC](https://community.cratedb.com/t/drop-blob-table-error/1106/6 "2022-05-24T09:23:01Z")

</div>

Great news !

I would like to update a cluster to the latest release (from 4.2.6) but Crate warns me that a BLOB table needs to be recreated (and I cannot drop it…). Will this be an issue if an update is attempted ?

---

<div class="post-metadata">

**Author:** ![jayeff](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/jayeff/32/271_2.png) [@jayeff](https://community.cratedb.com/u/jayeff)\
**Post date:** [May 24, 2022, 11:41am UTC](https://community.cratedb.com/t/drop-blob-table-error/1106/7 "2022-05-24T11:41:12Z")

</div>

@rps-v Can you share the warning you see regarding BLOB tables needs to be recreated?

We believe this warning is only relevant for major version upgrades (i.e. upgrading to 5.x) and upgrading to 4.7 or 4.8 should work fine. Before upgrading I recommend to create a [backup](https://crate.io/docs/crate/reference/en/latest/admin/snapshots.html) just in case something does not work as expected.

Potentially it’s also worth first restoring this blob table and some sample data on a cloned testing system for a update test-run before updating your production system.

---

<div class="post-metadata">

**Author:** ![rps-v](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/rps-v/32/342_2.png) [@rps-v](https://community.cratedb.com/u/rps-v)\
**Post date:** [May 24, 2022, 12:13pm UTC](https://community.cratedb.com/t/drop-blob-table-error/1106/8 "2022-05-24T12:13:11Z")

</div>

Here is the warning from Cluster Checks :

The following tables need to be recreated for compatibility with future major versions of CrateDB: [blob.mytable] [System information — CrateDB: Reference](https://cr8.is/d-cluster-check-3)

Will try to update first on a test system and see how it goes.

---

<div class="post-metadata">

**Author:** ![jayeff](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/jayeff/32/271_2.png) [@jayeff](https://community.cratedb.com/u/jayeff)\
**Post date:** [May 24, 2022, 12:31pm UTC](https://community.cratedb.com/t/drop-blob-table-error/1106/9 "2022-05-24T12:31:25Z")

</div>

@rps-v: With the following query you can check with which version your table was created:

```auto
SELECT 
  table_schema, table_name, version 
FROM information_schema.tables 
WHERE 
  table_schema NOT IN ('pg_catalog', 'sys', 'information_schema') 
LIMIT 100;

```

When `blob.mytable` was created with 4.x it should be compatible with all 4.x CrateDB versions.

---

<div class="post-metadata">

**Author:** ![rps-v](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/rps-v/32/342_2.png) [@rps-v](https://community.cratedb.com/u/rps-v)\
**Post date:** [May 24, 2022, 12:57pm UTC](https://community.cratedb.com/t/drop-blob-table-error/1106/10 "2022-05-24T12:57:48Z")

</div>

The table was created on Crate 3.x, here is the result:

```auto
created: 3.2.0
upgraded: 4.2.6

```

---

<div class="post-metadata">

**Author:** ![jayeff](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/jayeff/32/271_2.png) [@jayeff](https://community.cratedb.com/u/jayeff)\
**Post date:** [May 24, 2022, 1:26pm UTC](https://community.cratedb.com/t/drop-blob-table-error/1106/11 "2022-05-24T13:26:53Z")

</div>

Tables created with 3.x will need to be re-created before upgrading to 5.x. Upgrades to newer minor versions (4.3…4.8) can be done without re-creating the table first.

I would recommend to upgrade from 4.2.6 =\> 4.3.4 =\> 4.8.x (fix will be included in upcomping 4.7.3 and 4.8.1)

---

<div class="post-metadata">

**Author:** ![jayeff](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/jayeff/32/271_2.png) [@jayeff](https://community.cratedb.com/u/jayeff)\
**Post date:** [May 30, 2022, 7:50am UTC](https://community.cratedb.com/t/drop-blob-table-error/1106/12 "2022-05-30T07:50:07Z")

</div>

FYI: [CrateDB 4.7.3](https://crate.io/docs/crate/reference/en/latest/appendices/release-notes/4.7.3.html) and [4.8.1](https://crate.io/docs/crate/reference/en/latest/appendices/release-notes/4.8.1.html) are released. The official docker image will likely be available by tomorrow.
