Skip to content

[Bug]: Install command fails saying its already installed when it is not #66

@x7ryan

Description

@x7ryan

What happened?

The first time I try to run php artisan turso-php:install I get this:

Installing LibSQL Extension for PHP Installing libSQL Extension for PHP... 

✅ Found php ini at /etc/php/8.3/cli/php.ini 

In BaseInstaller.php line 237: Failed to fetch repository metadata: Client error: GET https://api.github.com/gists/99c0cc406968b50143539620dac2095e resulted in a 401 Unauthorized response: HTTP/1.1 401 Unauthorized Content-Type: application/json; charset=utf-8 X-Github-Media-Type: github.v3; format=json A (truncated...) 

Failed to install LibSQL Extension for PHP.

I tried to rerun it after adding my GitHub Personal Access Token only fr it to assume its already installed providing this output:

Installing LibSQL Extension for PHP 

Skipping installation... 
Use the update command to update the extension. 

LibSQL Extension for PHP installed successfully.

The PHP extension was in fact not installed, verified with php -i | grep libsql. Additionally running php artisan turso-php:update also confirmed with the response of:

LibSQL Extension for PHP is not installed.

The output

Skipping installation... 
Use the update command to update the extension.

is not found in the Laravel install command, so I assume it comes from the binary installer the Laravel command defers to, and it seems it does not actually check if it is installed but infers it from some file or state. After asking ChatGPT I ran the following and was able to get the installer to rerun and work:

rm -rf ~/.turso-client-php
rm -rf ~/.turso-php
rm -rf ~/.config/turso-client-php
rm -rf ~/.local/share/turso-client-php
rm -rf vendor
composer install

I am not sure which if those command actually fixed it but one or more of them seemed to reset its assumed state of it being installed so the installer could run again.

But perhaps the check to see if it is already installed should be a little bit more robust?

How to reproduce the bug

Add the composer dependency.

Run php artisan turso-php:install without authenticating to GitHub, after exhausting the guest rate limit.

Get the error: "Failed to fetch repository metadata: Client error: GET https://api.github.com/gists/99c0cc406968b50143539620dac2095e resulted in a 401 Unauthorized response"

Add your GH Personal Access Token

Re-run php artisan turso-php:install

Package Version

1.3.1

PHP Version

8.3

Laravel Version

12.26.4

Which operating systems does with happen with?

Linux

Notes

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions