Valet-plus: Brew was unable to install [wp-cli]

Created on 1 Jun 2018  路  10Comments  路  Source: weprovide/valet-plus

Valet install fails with this.. I guess it's some wordpress thing? I don't even want to use wordpress..

```
$ valet install
....
[wp-cli] Installing
==> Downloading https://github.com/wp-cli/wp-cli/releases/download/v1.5.1/wp-cli-1.5.1.phar
==> Downloading from https://github-production-release-asset-2e65be.s3.amazonaws.com/2360755/d8c715d6-64f7-11e8-804b-b446b2f9abc6?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20180601%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20180601T083048Z&X-Amz-Expires=300&X-Amz-Signature=4973fd8cfcbdbbdb9c9541833d74589388a4d91efaae2b3476f72a119ea618ef&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3Dwp-cli-1.5.1.phar&response-content-type=application%2Foctet-stream
Error: SHA256 mismatch
Expected: c1114450e647ca0c72afcbb6d02b577a55ec9915a510399579626c960d5dd2d2
Actual: 0cc7a95e68a2ef02fc423614806c29a8e76e4ac8c9b3e67d6673635d6eaea871
Archive: /Users/oskarmothander/Library/Caches/Homebrew/wp-cli-1.5.1.phar
To retry an incomplete download, remove the file above.

In Brew.php line 134:

Brew was unable to install [wp-cli].

Most helpful comment

@Neodork ok it works after deleting it! :)

rm -rf /Users/oskarmothander/Library/Caches/Homebrew/wp-cli-1.5.1.phar
rm -rf /usr/local/bin/wp

All 10 comments

https://make.wordpress.org/cli/handbook/installing/

Can it be optional to even install this?

That's is a security feature that prevents Valet-plus from installing a binary with a different sha then the original released file. I'll look into this the .phar might've had a re-release changing its sha value. Actually seems this is on the homebrew/core side since wp-cli is installed as a Dev tool instead of a custom binary.

Yes I agree that Valet-plus is packing a lot of features and in time we should create some sort of configuration which allows you to disable features you don't want/need.

Hi guys, I am there as well not sure how to work around this issue :(

Currently there is no workaround except for modifying the code. See https://github.com/weprovide/valet-plus/issues/179#issuecomment-393829841. Which is why I think @OZZlE's suggestion of being able to disable features you don't want valet-plus to install is a nice addition. If we want to go real in-depth we could also add a feature that disables the security around binary installations. But a feature like that would be dangerous to the user and should require a separate command.

I am a bit busy with the PECL switching and permissions issues surrounding valet-plus. I will fix the shasign with the next release along with the PECL switching. I will look into disabling features after I've fixed the PECL switching and permission issues.

Same here:

$ valet install [php] Checking for errors within the php installation... [nginx] Stopping [[email protected]] Stopping [[email protected]] Stopping [[email protected]] Stopping [mysql] Stopping [redis] Stopping [devtools] Installing tools [wp-cli] Installing Updating Homebrew... Error: SHA256 mismatch Expected: c1114450e647ca0c72afcbb6d02b577a55ec9915a510399579626c960d5dd2d2 Actual: 0cc7a95e68a2ef02fc423614806c29a8e76e4ac8c9b3e67d6673635d6eaea871 Archive: /Users/fma/Library/Caches/Homebrew/wp-cli-1.5.1.phar To retry an incomplete download, remove the file above.

I made a PR to fix it here: https://github.com/weprovide/valet-plus/pull/183

Seems like using it via homebrew is deprecated.

Alright guys so I looked into this. And it is as I mentioned in comment https://github.com/weprovide/valet-plus/issues/179#issuecomment-393829841 The .phar file has has a re-release. It seems all has been solved on the brew side:

https://github.com/wp-cli/wp-cli/issues/4816 <-- Issue in the WP-CLI queue.
https://github.com/Homebrew/homebrew-core/pull/28579 <-- Issue and solution (I think it's merged Yep merged 2 days ago) in the homebrew/core queue.

PR of homebrew/core solving the issue: https://github.com/Homebrew/homebrew-core/pull/28929

@OZZlE @FredericMartinez Could you retest the install?

PR #183 is ok.
馃憤

I fix my local valet installation by applying a patch with this PR.

 {
    "require": {
        "weprovide/valet-plus": "^1.0",
        "cweagans/composer-patches": "^1.6"
    },
    "extra": {
        "patches": {
            "weprovide/valet-plus": {
                "Fix WP-CLI": "patch/valet-pull-183.patch"
            }
        }
    }
}

@Neodork I updated to 1.0.18 of valet-plus, still the same issue, I guess it's not requiring the correct wp brew package still:

[wp-cli] Installing

Error: SHA256 mismatch
Expected: c1114450e647ca0c72afcbb6d02b577a55ec9915a510399579626c960d5dd2d2
Actual: 0cc7a95e68a2ef02fc423614806c29a8e76e4ac8c9b3e67d6673635d6eaea871
Archive: /Users/oskarmothander/Library/Caches/Homebrew/wp-cli-1.5.1.phar
To retry an incomplete download, remove the file above.

In Brew.php line 134:

Brew was unable to install [wp-cli].

@Neodork ok it works after deleting it! :)

rm -rf /Users/oskarmothander/Library/Caches/Homebrew/wp-cli-1.5.1.phar
rm -rf /usr/local/bin/wp

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Sironheart picture Sironheart  路  3Comments

guarinogabriel picture guarinogabriel  路  4Comments

kupoback picture kupoback  路  4Comments

Igloczek picture Igloczek  路  4Comments

dingo-d picture dingo-d  路  4Comments