microsoft / vscode-postgresql

PostgreSQL extension for VSCODE
Other
424 stars 53 forks source link

Problems after installation. Extension initializing #132

Open ecastellongl opened 2 months ago

ecastellongl commented 2 months ago

Steps to Reproduce:

  1. Open Visual Studio

  2. Install Extension

  3. Try to create a new query

  4. image
  5. PostgreSQL: Unable to execute the command while the extension is initializing. Please try again later.

alexkutner commented 1 month ago

I'm seeing this same issue. I'm also seeing PostgreSQL: Failed to load PostgreSQL Tools Service but the output is Initializing PostgreSQL tools service for the PostgreSQL extension. Note: PostgreSQL commands will be available after installing the service.

Platform-------------: darwin, arm64

orsisam commented 1 month ago

I have same issue too,

Visual Studio Code Version: 1.94.0 OS Version: Ubuntu 24.04

orsisam commented 1 month ago

I have same issue too,

Visual Studio Code Version: 1.94.0 OS Version: Ubuntu 24.04

This was fixed by installing the newest pgtoolsservices. just replace the old one with the latest version. Here I use version 1.10.

Link: https://github.com/microsoft/pgtoolsservice/releases?page=1

hrdwdmrbl commented 1 month ago

@orsisam Didn't work for me. Can you please specify EXACTLY where to place it?

Yes, I would restart the extension after each try.

orsisam commented 1 month ago

@orsisam Didn't work for me. Can you please specify EXACTLY where to place it?

* I tried: placing it in a number of different places inside of ms-ossdata.vscode-postgresql-0.3.0/pgsqltoolsservice but nothing worked.

* I even tried: renaming it to `pgtoolsservice_main` because that was the filename that [here](https://github.com/search?q=repo%3Amicrosoft%2Fvscode-postgresql+pgsqltoolsservice&type=code) but that didn't work either.

Yes, I would restart the extension after each try.

I placed it on .vscode/extensions/ms-ossdata.vscode-postgresql-0.3.0/pgsqltoolsservice/v1.4.0/Ubuntu16 and renamed the executable file to pgtoolservice_main.

hrdwdmrbl commented 1 month ago

@orsisam Thanks!

One odd thing for me is that the folder under v1.4.0 is "unknown".

~/.vscode/extensions/ms-ossdata.vscode-postgresql-0.3.0/pgsqltoolsservice/v1.4.0/Unknown/

But even after trying that it still fails with the same error...

snobb commented 3 weeks ago

I made it work by performing the following steps:

  1. I've changed the ~/.vscode-oss/extensions/ms-ossdata.vscode-postgresql-0.3.0/out/src/config.json to be like this (I'm on arm64 mac):
    "service": {
        "downloadUrl": "https://github.com/microsoft/pgtoolsservice/releases/download/{#version#}/pgsqltoolsservice-{#fileName#}",
        "version": "v1.10.0",
        "downloadFileNames": {
            "Windows_7_86": "win-x86.zip",
            "Windows_7_64": "win-x64.zip",
            "OSX_10_11_64": "osx.tar.gz",
            "CentOS_7": "linux-x64.tar.gz",
            "Debian_8": "linux-x64.tar.gz",
            "Fedora_23": "linux-x64.tar.gz",
            "OpenSUSE_13_2": "linux-x64.tar.gz",
            "SLES_12_2": "linux-x64.tar.gz",
            "RHEL_7": "linux-x64.tar.gz",
            "Ubuntu_14": "linux-x64.tar.gz",
            "Ubuntu_16": "linux-x64.tar.gz",
            "Unknown": "osx-arm64.tar.gz"
        },
        "installDir": "../pgsqltoolsservice/{#version#}/{#platform#}",
        "executableFiles": [
            "pgsqltoolsservice/ossdbtoolsservice_main",
            "pgsqltoolsservice/ossdbtoolsservice_main.exe"
        ]
    }
    }
  2. I downloaded the tarball manually and unzipped it into ~/.vscode-oss/extensions/ms-ossdata.vscode-postgresql-0.3.0/pgsqltoolsservice/v1.10.0/Unknown/.
  3. I ran the ossdbtoolsservice_main manually and then allowed opening in Settings->Security & Privacy.
  4. Restarted VSCodium
  5. It worked 🎉 (but will probably use some other extension)
hrdwdmrbl commented 3 weeks ago

@snobb Yes, that did work. Thanks! Knowing about the config file helped a lot. A couple things that tripped me up:

  1. Double-check the version you downloaded, the version in the dir path, and the version in the config
  2. Double-check the name of the executable. Mine unzipped as pgtoolsservice_main
  3. I did have to add the "Unknown": "osx-arm64.tar.gz" "downloadFileNames" myself
  4. Do restart VS, not just the extension.

My final path came to be: ~/.vscode/extensions/ms-ossdata.vscode-postgresql-0.3.0/pgsqltoolsservice/v1.10.0/Unknown/pgsqltoolsservice/pgtoolsservice_main