Invalid argument "type=bind,source=" for "--mount" flag: target is required

4 of db files got errors, node stop working

following problem fix as listed here:

8.1 step hits me with this error that i can’t pass… help

root@odroid:/mnt/StorJ/storagenode/storage# docker run --rm -it --mount type=bind,source= /mnt/StorJ/storagenode/storage#,destination=/storage sstc/sqlite3 sh
invalid argument “type=bind,source=” for “–mount” flag: target is required

Hi Rera, welcome!

Since it appears you are using an Odroid, you will be unable to use the Docker version of sqlite3 (it is unavailable for ARM last I checked). You will have to follow the steps for installing sqlite3 directly (Steps 5.2 and 8.2).

baker, thanks for replay. i had no problem to install and run sqlite3, problem is that i found where i was doing mistake in command and passed all steps from 9 to 14 for each db file - that was with error. rebooted odroid and now:

image

my all StorJ folder content disapeared:
image

How is your disk mounted in linux? You need to make an entry in fstab to make the mount persistent across reboots.

Should be

docker run --rm -it --mount type=bind,source=/mnt/StorJ/storagenode/storage,destination=/storage sstc/sqlite3 sh

And as @baker said - you cannot run it on arm-based device.

The empty mountpoint mean that your drive was shutdown (perhaps not enough power).
To check:

df -HT

And you definitely need to have a static mount: How do I setup static mount via /etc/fstab for Linux? - Storj Docs

managed to recover to where i was before. but still same problem that my 4 *.db files are with errors.
so i am trying same with powershell, i have sqlite file in my local C:, it runs there, but if i navigate to docker and run this command:

Get-ChildItem X:\storagenode\storage\*.db -File | %{$_.Name + " " + $(sqlite3.exe $_.FullName "PRAGMA integrity_check;")}

(X:\storagenode\storage\*.db - how properly define this one when it is in ip adress, not a disk)

getting errors:

Get-ChildItem - command not found.
sqlite3.exe - command not found.

what is proper way to run this?

p.s. i am newbie in these things.

You should replace that to your own path with databases.
Please, give me result of the command (PowerShell):

sls "storage.path" "C:\Program Files\Storj\Storage Nodes\config.yaml"

You should run it in PowerShell

You should install sqlite3. If you has installed it - specify full path to sqlite3.exe location.

Alexey, thanks for help. Got to step 13 where i should get the data from fixed sql file to db. error happens,

Error: near line 1: near “?PRAGMA”: syntax error

this is my all powershell screen:

Please, install Notepad++, open this dump_all_notrans.sql, change encoding to UTF8 without BOM and save it.
Then try to import again.
If error would persist, then you can:

  1. remove the bandwidth.db
  2. move all *.db to the backup folder
  3. run storagenode
    It will create all databases, but they would be empty
  4. Stop storagenode
  5. Restore all databases from backup folder with overwrite
  6. Start storagenode
  7. Check logs

Alexey, thank you for help. I manage to fix it with you advice.
there is not very clear manual how to do it in powershell (at least not for beginners). i made list of all steps that i did:

important to run powershell commands 1 by 1, otherwise some it was just not working

  1. download SQlite3 (important version, read steps)
    How To Download & Install SQLite Tools

  2. Sqlite 3 files place in location c:\sqlite (crate folder if needed)

  3. Please corrupted *.db file in c:\sqlite (in example bandwidth.db)

  4. Run PowerShell as administrator

  5. Navigate PowerShell to c:\sqlite
    replace *.db file name in all fallowing steps with the one with error, paste commands 1 by 1 in PowerShell
    checking if db file has error:

  6. Get-ChildItem C:\sqlite\bandwidth.db -File | %{_.Name + " " + (c:\sqlite\sqlite3.exe $_.FullName “PRAGMA integrity_check;”)}
    If yes, do all steps bellow:

  7. cp c:/sqlite/bandwidth.db c:/sqlite/bandwidth.db.bak

  8. c:/sqlite/sqlite3.exe bandwidth.db

  9. .mode insert

  10. .output dump_all.sql

  11. .dump

  12. .exit

  13. Get-Content dump_all.sql | Select-String -NotMatch TRANSACTION | Select-String -NotMatch ROLLBACK | Select-String -NotMatch COMMIT | Set-Content -Encoding utf8 dump_all_notrans.sql

  14. rm bandwidth.db

  15. c:/sqlite/sqlite3.exe c:/sqlite/bandwidth.db “.read c:/sqlite/dump_all_notrans.sql”

(15. command takes some time, do not rush)
if error: “Error: near line 1: near “?PRAGMA”: syntax error”
if no error: step 19.

  1. install Notepad++, open file “dump_all_notrans.sql”,
  2. change encoding to UTF8 without BOM and save it.
  3. Repeat steps 14 and 15
  4. ls c:sqlite/bandwidth.db
1 Like

It’s designed to check multiple DB files, so the command should be (assuming that your original storage location is D:\storage):

Get-ChildItem D:\storage\*.db -File | %{_.Name + " " + (c:\sqlite\sqlite3.exe $_.FullName "PRAGMA integrity_check;")}

For the only one file it’s much simpler:

c:\sqlite\sqlite3.exe C:\sqlite\bandwidth.db "PRAGMA integrity_check;"

Alexey, can you help with this error:

PS C:\sqlite> c:/sqlite/sqlite3.exe c:/sqlite/heldamount.db “.read c:/sqlite/dump_all_notrans.sql”
Error: near line 2: no such table: versions
Error: near line 3: no such table: versions
Error: near line 4: no such table: versions
Error: near line 5: no such table: versions
Error: near line 6: no such table: versions
Error: near line 7: no such table: versions
Error: near line 8: no such table: versions

To load data the database file should not exist. Please, remove c:/sqlite/heldamount.db before load