jorgebucaran / fisher

A plugin manager for Fish
https://git.io/fisher
MIT License
7.53k stars 257 forks source link

Incorrect error message: `fisher: Invalid plugin name or host unavailable: "ilancosman/tide@v5"` #767

Closed nhooey closed 12 months ago

nhooey commented 12 months ago

Problem

Fisher fails to install the Tide prompt:

user@hostname /Users/user > fisher install IlanCosman/tide@v5
fisher install version 4.4.3
Fetching https://api.github.com/repos/ilancosman/tide/tarball/v5
fisher: Invalid plugin name or host unavailable: "ilancosman/tide@v5"

Suggested fix

It would be best if Fisher output the actual error message from whatever library call it's making.

Cause

This worked initially, but is now failing after having uninstalled Tide with fisher remove IlanCosman/tide@v5 and then attempting to reinstall, as shown above.

Troubleshooting

However, Tide's tarball is downloadable:

user@hostname /Users/user > curl -I https://api.github.com/repos/ilancosman/tide/tarball/v5
HTTP/2 302
server: GitHub.com
date: Fri, 07 Jul 2023 06:39:19 GMT
content-type: text/html;charset=utf-8
content-length: 0
cache-control: public, must-revalidate, max-age=0
expires: Fri, 07 Jul 2023 06:39:19 GMT
location: https://codeload.github.com/IlanCosman/tide/legacy.tar.gz/refs/tags/v5
x-github-api-version-selected: 2022-11-28
x-ratelimit-limit: 60
x-ratelimit-remaining: 60
x-ratelimit-reset: 1688715559
x-ratelimit-used: 0
x-ratelimit-resource: core
access-control-expose-headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset
access-control-allow-origin: *
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
content-security-policy: default-src 'none'
vary: Accept-Encoding, Accept, X-Requested-With
x-github-request-id: D5A2:018E:A27AFA:A9442D:64A7B385
jorgebucaran commented 12 months ago

Can't reproduce.

fisher install version 4.4.3
Fetching https://api.github.com/repos/ilancosman/tide/tarball/v5
Installing ilancosman/tide@v5
           /Users/jb/.config/fish/functions/_tide_1_line_prompt.fish
            ...
Configure tide prompt? [Y/n] n

Run tide configure to customize your prompt.
Installed 1 plugin/s

~                                                                                                                                                          
❯ fisher remove ilancosman/tide@v5
fisher remove version 4.4.3
Removing ilancosman/tide@v5
         /Users/jb/.config/fish/functions/_tide_1_line_prompt.fish
         ...
Removed 1 plugin/s
jb@Titan /Users/jb > fisher install ilancosman/tide@v5
fisher install version 4.4.3
Fetching https://api.github.com/repos/ilancosman/tide/tarball/v5
Installing ilancosman/tide@v5
           /Users/jb/.config/fish/functions/_tide_1_line_prompt.fish
            ...
Configure tide prompt? [Y/n] n

Run tide configure to customize your prompt.
Installed 1 plugin/s

~                                                                                                                                                          
❯ fisher remove ilancosman/tide@v5
fisher remove version 4.4.3
Removing ilancosman/tide@v5
         /Users/jb/.config/fish/functions/_tide_1_line_prompt.fish
         ...
Removed 1 plugin/s
jb@Titan /Users/jb > 
nhooey commented 12 months ago

@jorgebucaran: Are you able to successfully grab Tide and extract it? This comes from this curl command in the Fisher source.

I get an error when I run it:

$ curl --silent -L https://api.github.com/repos/ilancosman/tide/tarball/v5 | tar -xzC /tmp/tide -f -
gzip: (stdin): trailing garbage ignored
tar: Child returned status 2
tar: Error is not recoverable: exiting now
nhooey commented 12 months ago

Never mind, I had this in my curl configuration:

# ~/.curlrc
-w "\n"

Found it in this GitHub comment from this Google query: "curl" "trailing garbage ignored".

jorgebucaran commented 12 months ago

I sure hope this isn't related to https://github.com/jorgebucaran/fisher/pull/766, which we just incorporated a few days ago.

In any case, whether with or without it, I'm able to successfully install Tide as demonstrated in my previous console output

nhooey commented 12 months ago

I sure hope this isn't related to https://github.com/jorgebucaran/fisher/pull/766, which we just incorporated a few days ago.

It's definitely not. Curl was outputting corrupt data because of my Curl configuration, which caused Tar to error, all quietly because Fisher hides all error output for that command.

It's all good, no action required from you.