# Neu erstellen der bandwidth.db schlägt fehlt

**URL:** <https://forum.storj.io/t/neu-erstellen-der-bandwidth-db-schlagt-fehlt/19028>\
**Category:** troubleshooting\
**Tags:** auf-deutsch, database\
**Created:** [July 12, 2022, 10:04am UTC](https://forum.storj.io/t/neu-erstellen-der-bandwidth-db-schlagt-fehlt/19028 "2022-07-12T10:04:49Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![padso](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/padso/32/8992_2.png) [@padso](https://forum.storj.io/u/padso)\
**Post date:** [July 12, 2022, 10:04am UTC](https://forum.storj.io/t/neu-erstellen-der-bandwidth-db-schlagt-fehlt/19028/1 "2022-07-12T10:04:49Z")

</div>

Moin,

ich habe die db “gelöscht” um zu testen, ob es ein geschwindigkeitsproblem mit der api löst.  
Ein neu erstellen der DB schlägt allerdings fehl. Ist ein einfachs löschen nicht möglich?  
 →

```auto
2022-07-12T12:00:13.735+0200 INFO db.migration Database Version {"Process": "storagenode", "version": 53}
Error: Error during preflight check for storagenode databases: preflight: database "bandwidth": expected schema does not match actual: &dbschema.Schema{
- Tables: []*dbschema.Table{
- (
- s"""
- Name: bandwidth_usage
- Columns:
- Name: action
- Type: INTEGER
- Nullable: false
- Default: ""
- Reference: nil
- Name: amount
- Type: BIGINT
- Nullable: false
- Default: ""
- Reference: nil
- Name: created_at
- Type: TIMESTAMP
- Nullable: false
- ... // 12 elided lines
- s"""
- ),
- (
- s"""
- Name: bandwidth_usage_rollups
- Columns:
- Name: action
- Type: INTEGER
- Nullable: false
- Default: ""
- Reference: nil
- Name: amount
- Type: BIGINT
- Nullable: false
- Default: ""
- Reference: nil
- Name: interval_start
- Type: TIMESTAMP
- Nullable: false
- ... // 12 elided lines
- s"""
- ),
- },
+ Tables: nil,
- Indexes: []*dbschema.Index{
- s`Index<Table: bandwidth_usage, Name: idx_bandwidth_usage_created, Columns: created_at, Unique: false, Partial: "">`,
- s`Index<Table: bandwidth_usage, Name: idx_bandwidth_usage_satellite, Columns: satellite_id, Unique: false, Partial: "">`,
- },
+ Indexes: nil,
        Sequences: nil,
  }

        storj.io/storj/storagenode/storagenodedb.(*DB).preflight:406
        storj.io/storj/storagenode/storagenodedb.(*DB).Preflight:353
        main.cmdRun:241
        storj.io/private/process.cleanup.func1.4:372
        storj.io/private/process.cleanup.func1:390
        github.com/spf13/cobra.(*Command).execute:852
        github.com/spf13/cobra.(*Command).ExecuteC:960
        github.com/spf13/cobra.(*Command).Execute:897
        storj.io/private/process.ExecWithCustomConfigAndLogger:93
        main.main:479
        runtime.main:255
2022-07-12 12:00:13,754 INFO exited: storagenode (exit status 1; not expected

```

---

<div class="post-metadata">

**Author:** ![Walter1](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/walter1/32/7825_2.png) [@Walter1](https://forum.storj.io/u/Walter1)\
**Post date:** [July 12, 2022, 3:24pm UTC](https://forum.storj.io/t/neu-erstellen-der-bandwidth-db-schlagt-fehlt/19028/2 "2022-07-12T15:24:51Z")

</div>

Meinst du die recovations.db? Und wenn ja, die aus der Identity oder aus den Daten neben der config.yaml?

---

<div class="post-metadata">

**Author:** ![Stob](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/stob/32/1137_2.png) [@Stob](https://forum.storj.io/u/Stob)\
**Post date:** [July 12, 2022, 3:46pm UTC](https://forum.storj.io/t/neu-erstellen-der-bandwidth-db-schlagt-fehlt/19028/3 "2022-07-12T15:46:05Z")

</div>

It is not recommended to delete the .db files as they are not individually created on node restart.

You could use this method - [https://support.storj.io/hc/en-us/articles/4403032417044-How-to-fix-database-file-is-not-a-database-error](https://support.storj.io/hc/en-us/articles/4403032417044-How-to-fix-database-file-is-not-a-database-error) - to create all new blank databases and then copy the one you need.

It is unlikely a database would be slowing down your node api.

---

<div class="post-metadata">

**Author:** ![Alexey](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/alexey/32/41_2.png) [@Alexey](https://forum.storj.io/u/Alexey)\
**Post date:** [July 12, 2022, 6:45pm UTC](https://forum.storj.io/t/neu-erstellen-der-bandwidth-db-schlagt-fehlt/19028/4 "2022-07-12T18:45:36Z")

</div>

Zur Antwort von @Stob kann ich nur hinzufügen, dass Sie nach dem Wiederaufbau historische Bandbreitennutzungsstatistiken verlieren werden.

---

<div class="post-metadata">

**Author:** ![padso](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/padso/32/8992_2.png) [@padso](https://forum.storj.io/u/padso)\
**Post date:** [July 13, 2022, 6:35am UTC](https://forum.storj.io/t/neu-erstellen-der-bandwidth-db-schlagt-fehlt/19028/5 "2022-07-13T06:35:57Z")

</div>

Irgendwas stimmt mit der DB aber nicht. Die DB liegt auf einer SSD und ist trotzdem total langsam.  
Außerdem gibt es immer wieder den Error “db is locked”.  
Ich habe zwei weitere Nodes die keine Probleme haben.

von 0 zu starten ist eigentlich nicht mein wunsch, aber ich habe keine andere Lösung gefunden bisher.

---

<div class="post-metadata">

**Author:** ![Alexey](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/alexey/32/41_2.png) [@Alexey](https://forum.storj.io/u/Alexey)\
**Post date:** [July 13, 2022, 8:16am UTC](https://forum.storj.io/t/neu-erstellen-der-bandwidth-db-schlagt-fehlt/19028/6 "2022-07-13T08:16:14Z")

</div>

Es ist nicht notwendig, bei Null anzufangen. Wenn einige Datenbanken immer noch beschädigt sind, müssen sie auch gemäß der Anleitung repariert werden: [https://support.storj.io/hc/en-us/articles/360029309111-How-to-fix-a-database-disk-image-is-malformed-](https://support.storj.io/hc/en-us/articles/360029309111-How-to-fix-a-database-disk-image-is-malformed-) oder gemäß dieser Anleitung neu erstellt werden: [https://support.storj.io/hc/en-us/articles/4403032417044-How-to-fix-database-file-is-not-a-database-error](https://support.storj.io/hc/en-us/articles/4403032417044-How-to-fix-database-file-is-not-a-database-error)

Es ist natürlich seltsam, den Fehler „Datenbank ist gesperrt“ zu sehen, wenn sich Ihre Datenbanken wirklich auf der SSD befinden. Ein solcher Fehler behebt sich entweder von selbst oder es reicht ein Neustart des Knotens.

---

<div class="post-metadata">

**Author:** ![padso](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/padso/32/8992_2.png) [@padso](https://forum.storj.io/u/padso)\
**Post date:** [July 13, 2022, 8:27am UTC](https://forum.storj.io/t/neu-erstellen-der-bandwidth-db-schlagt-fehlt/19028/7 "2022-07-13T08:27:45Z")

</div>

Ich werde versuchen die DB zu reparieren. Der Fehler ist schon seit einigen Neustarts vorhanden.  
Die DB ist 3,6 Gb groß, der Knoten ca. 16 monate alt. Mal sehen ob ich damit weiter komme 🙂

---

<div class="post-metadata">

**Author:** ![padso](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/padso/32/8992_2.png) [@padso](https://forum.storj.io/u/padso)\
**Post date:** [July 20, 2022, 5:39pm UTC](https://forum.storj.io/t/neu-erstellen-der-bandwidth-db-schlagt-fehlt/19028/8 "2022-07-20T17:39:12Z")

</div>

Leider hat das reparieren nichts gebracht.  
Ich habe jetzt alle DB’s gelöscht und nun läuft es ohne Probleme.  
Falls gewünscht, ich habe noch eine Sicherungskopie, die ich zur Verfügung stellen kann.
