microsoft / azuredatastudio-postgresql

azuredatastudio-postgresql is an extension for Azure Data Studio that enables you to work with PostgreSQL databases
Other
195 stars 37 forks source link

PostgreSQL v0.3.1 breaks Linux support #392

Closed karabaja4 closed 1 year ago

karabaja4 commented 1 year ago

Hello,

seems that an upgrade of PostgreSQL to v0.3.1 does not include Linux support:

2023-05-30_22-12

Upon further investigation seems config.json does not include pgtoolsservice Linux download definition at all, which is why service-downloader fails to download it.

Also pgtoolsservice v1.7.1 releases page doesn't seem to include a Linux precompiled version which would be where the extension would look for it.

I successfully managed to compile my own pgtoolsservice for Linux and run it with the extension, but it's been a hassle.

Is this extension not packaged for Linux anymore?

patrykwegrzyn commented 1 year ago

im having the same issue

alllballls commented 1 year ago

same.

GaryHopeMS commented 1 year ago

The lack inclusion of Linux binaries as part of the v0.3.1 build was a miss, it will be addressed as part of the next release (M2). See https://github.com/microsoft/azuredatastudio-postgresql/issues/397 In the interim please download and install the v0.2.7 release from https://github.com/microsoft/azuredatastudio-postgresql/releases/tag/v0.2.7 using the instructions to install extension from VSX here https://learn.microsoft.com/en-us/sql/azure-data-studio/extensions/add-extensions?view=sql-server-ver16#install-from-a-vsix

jasonweaver commented 1 year ago

In the interim please download and install the v0.2.7 release from https://github.com/microsoft/azuredatastudio-postgresql/releases/tag/v0.2.7 using the instructions to install extension from VSX here https://learn.microsoft.com/en-us/sql/azure-data-studio/extensions/add-extensions?view=sql-server-ver16#install-from-a-vsix

In addition to manually installing the extension I had to also chmod ossdbtoolsservice_main per this.

nasc17 commented 1 year ago

Issue has been addressed in our unstable release of PostgreSQL extension v0.4.0-insiders. We would appreciate your verification that it has been handled appropriately.

karabaja4 commented 1 year ago

@nasc17

Download still fails because service-downloader downloadFileNames object has "Linux_64" field and platform parameter (on Arch Linux) for me is "Ubuntu_16", which also seems to be default in getRuntimeIdLinux (I assume Arch is using Ubuntu prebuilt).

However, if I cheat and modify serviceDownloadProvider.js this way:

L85    //const fileName = this.getDownloadFileName(platform);
L86    const installDirectory = this.getInstallDirectory(platform);
L87    const urlString = 'https://github.com/microsoft/pgtoolsservice/releases/download/1.8.0-insiders/pgsqltoolsservice-linux-x64-insiders.tar.gz';

The pgsqltoolsservice is downloaded but fails to start when the download is finished: image

However after a restart Postgres extension seems to work: image image

nasc17 commented 1 year ago

@nasc17

Download still fails because service-downloader downloadFileNames object has "Linux_64" field and platform parameter (on Arch Linux) for me is "Ubuntu_16", which also seems to be default in getRuntimeIdLinux (I assume Arch is using an Ubuntu prebuilt).

However, if I cheat and modify serviceDownloadProvider.js this way:

L85    //const fileName = this.getDownloadFileName(platform);
L86    const installDirectory = this.getInstallDirectory(platform);
L87    const urlString = 'https://github.com/microsoft/pgtoolsservice/releases/download/1.8.0-insiders/pgsqltoolsservice-linux-x64-insiders.tar.gz';

The pgsqltoolsservice is downloaded but fails to start when the download is finished: image

However after a restart Postgres extension seems to work: image image

Thank you so much for quick feedback. We will keep you posted on updates. Stable version of extension will be released soon.

karabaja4 commented 1 year ago

Hi @nasc17

Trying to install v0.4.1 from the Extensions screen still fails with Failed to start PGSQL tools service, because this._config.downloadFileNames in node_modules/service-downloader/out/serviceDownloadProvider.js still does not include Ubuntu_16:

JSON.stringify(this._config)

{
    "executableFiles": [
        "pgsqltoolsservice/ossdbtoolsservice_main",
        "pgsqltoolsservice/ossdbtoolsservice_main.exe"
    ],
    "installDirectory": "/home/igor/.azuredatastudio/extensions/microsoft.azuredatastudio-postgresql-0.4.1/out/ossdbtoolsservice/{#platform#}/{#version#}",
    "downloadFileNames": {
        "OSX_ARM64": "osx-arm64.tar.gz",
        "Windows_86": "win-x86.zip",
        "Windows_64": "win-x64.zip",
        "OSX": "osx.tar.gz",
        "Linux_64": "linux-x64.tar.gz"
    },
    "version": "v1.8.0",
    "downloadUrl": "https://github.com/Microsoft/pgtoolsservice/releases/download/{#version#}/pgsqltoolsservice-{#fileName#}",
    "proxy": "",
    "strictSSL": true
}

P.S. Why is there a switch case for every distribution name/version, for example node_modules/service-downloader/out/platform.js in getRuntimeIdLinux(), if they all use the same binary (tarball) linux-x64.tar.gz? Couldn't all distributions just use the same runtime ID?

nasc17 commented 1 year ago

Hi @karabaja4 The config file has been updated in version 0.4.2 of the extension. We would appreciate if you could help to verify this has resolved your issue. Thank you.

karabaja4 commented 1 year ago

Hi @nasc17 , yes it works now. Thanks for resolving this issue, I will close it now.