vscode-sqlite: Can't open database

  • version: 0.8.0
  • os: Debian 10

When I try to open sqlite file I get

Unable to find a valid SQLite command. Fallback binary is not valid.

and

[2:37:39 AM][vscode-sqlite][ERROR] Unable to find a valid SQLite command. Fallback binary is not valid.

I saw a very similar closed issue that occurred in CentOS. It’s said that it is fixed by some ad-hoc solution specific for CentOS. I suspect the same reason and it can be fixed in the same way but this time for Debian 10?

The issue is referenced below.


Should be fixed in version 0.7.1 There were a couple of problems: It failed to recognize if the SQLite binaries were not supported (it’s needed at least version 3.9), and on CentOS the binaries provided throw an error when started, but work fine after that. I fixed the first problem and added a workaround for the second. If there are other errors feel free to reopen this issue.

_Originally posted by @AlexCovizzi in https://github.com/AlexCovizzi/vscode-sqlite/issues/71#issuecomment-504095860_

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 29 (4 by maintainers)

Most upvoted comments

It exited right away. After I read the error message I tried installing sqlite3 using apt and it worked. I’m happy with the solution so I would close the issue.

@ingun37 @vaMuchenje @guilhermebellotti @AlexCovizzi @W3ND31 @SrAmaral @matias2018 @ricardovasconcelos @joao-gabriel-gois

I decided by doing: sudo apt-get install sqlite3 libsqlite3-dev

Then, in settings.json sets the path to the sqlite3 binary: "sqlite.sqlite3": "/usr/bin/sqlite3"

Parece besteira, mas além de instalar o pacote via apt sudo apt install sqlite3, reiniciei o VSCode e tentei abrir novamente o arquivo, mas deu o mesmo erro Unable to find a valid SQLite command. Fallback binary is not valid. Então, selecionei o arquivo na mão, ao invés de usar a sugestão que estava aparecendo e funcionou hahaha. 🚀

Guys, u don’t need this. If u enabled “sqlite.logLevel”:“DEBUG” on VsCode JSON Settings, look for the file like “/home/wendel/.vscode/extensions/alexcvzz.vscode-sqlite-0.8.2/bin/sqlite-v3.26.0-linux-x64”

Go to terminal and type “chmod +x /home/wendel/.vscode/extensions/alexcvzz.vscode-sqlite-0.8.2/bin/sqlite-v3.26.0-linux-x64”

And the issue is resolved without installing anything else.

I think that this will happen only on unix SO’s.

Hi, I just had the same issue. I’m using Ubuntu 18.04.4 LTS.

Just to add, this solution that @ingun37 mentioned also worked for me:

It exited right away. After I read the error message I tried installing sqlite3 from apt and it worked. I’m happy with the solution so I can close the issue but I’m also happy to support for you to fix this issue. Let me know if you need anything.

But differently from others, my output could not identifies sqlite3 in my /bin/sh, and tried to run inside .vscode/extensions respective extension bin directory, found it but got permission denied. Even when it finds the binary, in cases like mine, it wasn’t running. Hope this info helps, in case if wasn’t expected.

In case of someone gets the same output I had, installing through apt works.

Output logs:

[00:53:50][vscode-sqlite][INFO] Activating extension vscode-sqlite v0.8.2...
[00:53:50][vscode-sqlite][ERROR] Unable to find a valid SQLite command. Fallback binary is not valid.
[00:53:50][vscode-sqlite][INFO] Extension activated.
[01:05:32][vscode-sqlite][DEBUG] 'sqlite3' is not a valid SQLite command: /bin/sh: 1: sqlite3: not found
[01:05:32][vscode-sqlite][DEBUG] Fallback SQLite binary found: '/home/pudou/.vscode/extensions/alexcvzz.vscode-sqlite-0.8.2/bin/sqlite-v3.26.0-linux-x64'.
[01:05:32][vscode-sqlite][DEBUG] '/home/pudou/.vscode/extensions/alexcvzz.vscode-sqlite-0.8.2/bin/sqlite-v3.26.0-linux-x64' is not a valid SQLite command: /bin/sh: 1: /home/pudou/.vscode/extensions/alexcvzz.vscode-sqlite-0.8.2/bin/sqlite-v3.26.0-linux-x64: Permission denied
[01:05:32][vscode-sqlite][ERROR] Unable to find a valid SQLite command. Fallback binary is not valid.

Vlw @joao-gabriel-gois salvou minha NextLevelWeek

@W3ND31 You’re right, totally make sense.

I had no issues or limitation to install sqilite3, but yes, I think in order to isolate as a solution only for the vscode extension to work, your solution is better.

chmod +x <extension-binary-path>

PS: pros BR, também to na next level, avuaaaa! 🚀 🚀 🚀

Guys, u don’t need this. If u enabled “sqlite.logLevel”:“DEBUG” on VsCode JSON Settings, look for the file like “/home/wendel/.vscode/extensions/alexcvzz.vscode-sqlite-0.8.2/bin/sqlite-v3.26.0-linux-x64”

Go to terminal and type “chmod +x /home/wendel/.vscode/extensions/alexcvzz.vscode-sqlite-0.8.2/bin/sqlite-v3.26.0-linux-x64”

And the issue is resolved without installing anything else.

I think that this will happen only on unix SO’s.

Same problem here on WSLv2 using an Ubuntu20.04 image.

[12:05:20 PM][vscode-sqlite][ERROR] Failed to open database '/home/xxx/code/apollographql/fullstack-tutorial/final/server/store.sqlite': SQLite process failed to start: The argument 'file' cannot be empty. Received ''

In a terminal I then

> cd /home/xxx/.vscode-server/extensions/alexcvzz.vscode-sqlite-0.14.0/bin
> ./sqlite-v3.26.0-linux-x64 --help
./sqlite-v3.26.0-linux-x64: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
> ldd ./sqlite-v3.26.0-linux-x64
        linux-vdso.so.1 (0x00007ffe6591a000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f5d8cacc000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f5d8caa9000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f5d8c95a000)
        libtinfo.so.5 => not found
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f5d8c768000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f5d8cadf000)

Looking at the libs on my Ubuntu system:

> ls -l /usr/lib/x86_64-linux-gnu/libtinfo*
-rw-r--r-- 1 root root 306676 Feb 26  2020 /usr/lib/x86_64-linux-gnu/libtinfo.a
lrwxrwxrwx 1 root root     35 Feb 26  2020 /usr/lib/x86_64-linux-gnu/libtinfo.so -> /lib/x86_64-linux-gnu/libtinfo.so.6
lrwxrwxrwx 1 root root     15 Feb 26  2020 /usr/lib/x86_64-linux-gnu/libtinfo.so.6 -> libtinfo.so.6.2
-rw-r--r-- 1 root root 192032 Feb 26  2020 /usr/lib/x86_64-linux-gnu/libtinfo.so.6.2

It seems I have libtinfo.so.6 but not libtinfo.so.5.

Parece besteira, mas além de instalar o pacote via apt sudo apt install sqlite3, reiniciei o VSCode e tentei abrir novamente o arquivo, mas deu o mesmo erro Unable to find a valid SQLite command. Fallback binary is not valid. Então, selecionei o arquivo na mão, ao invés de usar a sugestão que estava aparecendo e funcionou hahaha.

Solved my problem, as I just needed to install sqlite3 with sudo apt … thanks

I got the same error, I solved installing apt-get install sqlite3 and apt-get install libsqlite3-dev and it worked as well

It exited right away. After I read the error message I tried installing sqlite3 using apt and it worked. I’m happy with the solution so I would close the issue.

Salvou minha NextLevelWeek também Saved my NLW too tks a lot

Add permissions didn’t work for me. I had SQLite installed previously too. I’m using Ubuntu 18.04. The file is being used and working, but I can’t (humanly) read it on VSCode.

Any suggestions, please? Screenshot from 2020-06-18 23-05-22