lovell / sharp-libvips

Packaging scripts to prebuild libvips and its dependencies - you're probably looking for https://github.com/lovell/sharp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Integrity hash mismatches when downloading sharp-libvips package in expo/eas deployment pipeline

ladyshaitan opened this issue · comments

I'm consistently getting this integrity mismatch error when attempting to deploy an android build in the expo / eas development managed workflow.
Screenshot 2023-05-20 at 11 35 22 AM

Installed software:
- NDK 21.4.7075529
- Node.js 16.18.1
- Yarn 1.22.17
- pnpm 7.0.0
- npm 1.22.17
- Java 11
- Expo CLI 6.0.0
[stderr] 
npm ERR! code 1
[stderr] 
npm ERR! path /home/expo/workingdir/build/node_modules/sharp
[stderr] 
npm ERR! command failed
[stderr] 
npm ERR! command sh -c (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)
[stderr] 
npm ERR! sharp: Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.14.2/libvips-8.14.2-linux-x64.tar.br
[stderr] 
npm ERR! sharp: Integrity expected: sha512-wjCKmWfBb0uz1UB7rPDLvO0s+VWuoAY/Vv/YGCRFEQUkdSLQUgHExrOMMbOM3FleuYfQqznDYCXXphkl7X44+w==
[stderr] 
npm ERR! sharp: Integrity received: sha512-z4PhNX7vuL3xVChQ1m2AB9Yg5AULVxXcg/SpIdNs6c5H0NE8XYXysP+DGNKHfuwvY7kxvUdBeoGlODJ6+SfaPg==
[stderr] 
npm ERR! sharp: Please see https://sharp.pixelplumbing.com/install for required dependencies
[stderr] 
npm ERR! sharp: Installation error: Integrity check failed for linux-x64
[stderr] 
[stderr] 
npm ERR!
[stderr] 
A complete log of this run can be found in:
[stderr] 
npm ERR!     /home/expo/.npm/_logs/2023-05-20T18_31_21_027Z-debug-0.log

Output of npm why sharp

sharp@0.32.1 dev
node_modules/appium-uiautomator2-driver/node_modules/sharp
  sharp@"^0.x" from appium-android-driver@5.12.1
  node_modules/appium-uiautomator2-driver/node_modules/appium-android-driver
    appium-android-driver@"^5.12.1" from appium-uiautomator2-driver@2.24.1
    node_modules/appium-uiautomator2-driver
      dev appium-uiautomator2-driver@"^2.12.7" from the root project

sharp@0.32.1 extraneous
node_modules/appium-xcuitest-driver/node_modules/sharp

sharp@0.32.1 dev
node_modules/sharp
  sharp@"0.32.1" from @appium/support@4.0.1
  node_modules/@appium/support
    @appium/support@"^4.0.1" from @appium/base-driver@9.3.10
    node_modules/@appium/base-driver
      @appium/base-driver@"^9.3.10" from @appium/base-plugin@2.2.10
      node_modules/@appium/base-plugin
        @appium/base-plugin@"^2.2.10" from appium@2.0.0-beta.71
        node_modules/appium
          dev appium@"^2.0.0-beta.57" from the root project
          peer appium@"^2.0.0-beta.48" from @appium/typedoc-plugin-appium@0.6.4
          node_modules/@appium/typedoc-plugin-appium
            @appium/typedoc-plugin-appium@"^0.6.4" from @appium/docutils@0.3.13
            node_modules/@appium/docutils
              @appium/docutils@"^0.3.13" from appium@2.0.0-beta.71
          peer appium@"^2.0.0-beta.40" from appium-uiautomator2-driver@2.24.1
          node_modules/appium-uiautomator2-driver
            dev appium-uiautomator2-driver@"^2.12.7" from the root project
          peer appium@"^2.0.0-beta.48" from @appium/typedoc-plugin-appium@0.6.3
          node_modules/appium-uiautomator2-driver/node_modules/@appium/typedoc-plugin-appium
            @appium/typedoc-plugin-appium@"^0.6.3" from @appium/docutils@0.3.9
            node_modules/appium-uiautomator2-driver/node_modules/@appium/docutils
          peer appium@"^2.0.0-beta.40" from appium-android-driver@5.12.1
          node_modules/appium-uiautomator2-driver/node_modules/appium-android-driver
            appium-android-driver@"^5.12.1" from appium-uiautomator2-driver@2.24.1
            node_modules/appium-uiautomator2-driver
              dev appium-uiautomator2-driver@"^2.12.7" from the root project
      @appium/base-driver@"^9.3.10" from appium@2.0.0-beta.71
      node_modules/appium
        dev appium@"^2.0.0-beta.57" from the root project
        peer appium@"^2.0.0-beta.48" from @appium/typedoc-plugin-appium@0.6.4
        node_modules/@appium/typedoc-plugin-appium
          @appium/typedoc-plugin-appium@"^0.6.4" from @appium/docutils@0.3.13
          node_modules/@appium/docutils
            @appium/docutils@"^0.3.13" from appium@2.0.0-beta.71
        peer appium@"^2.0.0-beta.40" from appium-uiautomator2-driver@2.24.1
        node_modules/appium-uiautomator2-driver
          dev appium-uiautomator2-driver@"^2.12.7" from the root project
        peer appium@"^2.0.0-beta.48" from @appium/typedoc-plugin-appium@0.6.3
        node_modules/appium-uiautomator2-driver/node_modules/@appium/typedoc-plugin-appium
          @appium/typedoc-plugin-appium@"^0.6.3" from @appium/docutils@0.3.9
          node_modules/appium-uiautomator2-driver/node_modules/@appium/docutils
        peer appium@"^2.0.0-beta.40" from appium-android-driver@5.12.1
        node_modules/appium-uiautomator2-driver/node_modules/appium-android-driver
          appium-android-driver@"^5.12.1" from appium-uiautomator2-driver@2.24.1
          node_modules/appium-uiautomator2-driver
            dev appium-uiautomator2-driver@"^2.12.7" from the root project
    @appium/support@"^4.0.1" from @appium/base-plugin@2.2.10
    node_modules/@appium/base-plugin
      @appium/base-plugin@"^2.2.10" from appium@2.0.0-beta.71
      node_modules/appium
        dev appium@"^2.0.0-beta.57" from the root project
        peer appium@"^2.0.0-beta.48" from @appium/typedoc-plugin-appium@0.6.4
        node_modules/@appium/typedoc-plugin-appium
          @appium/typedoc-plugin-appium@"^0.6.4" from @appium/docutils@0.3.13
          node_modules/@appium/docutils
            @appium/docutils@"^0.3.13" from appium@2.0.0-beta.71
        peer appium@"^2.0.0-beta.40" from appium-uiautomator2-driver@2.24.1
        node_modules/appium-uiautomator2-driver
          dev appium-uiautomator2-driver@"^2.12.7" from the root project
        peer appium@"^2.0.0-beta.48" from @appium/typedoc-plugin-appium@0.6.3
        node_modules/appium-uiautomator2-driver/node_modules/@appium/typedoc-plugin-appium
          @appium/typedoc-plugin-appium@"^0.6.3" from @appium/docutils@0.3.9
          node_modules/appium-uiautomator2-driver/node_modules/@appium/docutils
        peer appium@"^2.0.0-beta.40" from appium-android-driver@5.12.1
        node_modules/appium-uiautomator2-driver/node_modules/appium-android-driver
          appium-android-driver@"^5.12.1" from appium-uiautomator2-driver@2.24.1
          node_modules/appium-uiautomator2-driver
            dev appium-uiautomator2-driver@"^2.12.7" from the root project
    @appium/support@"^4.0.1" from @appium/docutils@0.3.13
    node_modules/@appium/docutils
      @appium/docutils@"^0.3.13" from appium@2.0.0-beta.71
    @appium/support@"^4.0.1" from appium@2.0.0-beta.71
    node_modules/appium
      dev appium@"^2.0.0-beta.57" from the root project
      peer appium@"^2.0.0-beta.48" from @appium/typedoc-plugin-appium@0.6.4
      node_modules/@appium/typedoc-plugin-appium
        @appium/typedoc-plugin-appium@"^0.6.4" from @appium/docutils@0.3.13
        node_modules/@appium/docutils
          @appium/docutils@"^0.3.13" from appium@2.0.0-beta.71
      peer appium@"^2.0.0-beta.40" from appium-uiautomator2-driver@2.24.1
      node_modules/appium-uiautomator2-driver
        dev appium-uiautomator2-driver@"^2.12.7" from the root project
      peer appium@"^2.0.0-beta.48" from @appium/typedoc-plugin-appium@0.6.3
      node_modules/appium-uiautomator2-driver/node_modules/@appium/typedoc-plugin-appium
        @appium/typedoc-plugin-appium@"^0.6.3" from @appium/docutils@0.3.9
        node_modules/appium-uiautomator2-driver/node_modules/@appium/docutils
      peer appium@"^2.0.0-beta.40" from appium-android-driver@5.12.1
      node_modules/appium-uiautomator2-driver/node_modules/appium-android-driver
        appium-android-driver@"^5.12.1" from appium-uiautomator2-driver@2.24.1
        node_modules/appium-uiautomator2-driver
          dev appium-uiautomator2-driver@"^2.12.7" from the root project

Output of npm why sharp-libvips:
Screenshot 2023-05-20 at 11 52 21 AM

Why would this error consistently occur in my android build but not my ios build? Do I have control over whether the checksums match?

Hi, this is a security feature of sharp to help ensure the binaries you're using match those published.

Is there any kind of proxy service between the machine this is running on and the Internet? If so, could it be altering file contents?

Are you able to download https://github.com/lovell/sharp-libvips/releases/download/v8.14.2/libvips-8.14.2-linux-x64.tar.br at the command line? Do the contents match when you download the same URL from another machine?

npm ERR! sharp: Integrity received: sha512-z4PhNX7vuL3xVChQ1m2AB9Yg5AULVxXcg/SpIdNs6c5H0NE8XYXysP+DGNKHfuwvY7kxvUdBeoGlODJ6+SfaPg==

I've just realised that this is the SHA512 hash of a zero length file, so my best guess would be that something is preventing the download from occurring.

I've just realised that this is the SHA512 hash of a zero length file, so my best guess would be that something is preventing the download from occurring.

Interesting. I'll play around with it, I'm confident that this is not anything to do with sharp now. It must be something to do with the eas workflow we use. It was nice in the beginning but can be kind of a pain since we can't change anything about it at a finer level. I'll hit them up, the tip about the zero length file is a really helpful clue.

Thanks for the update, I'll close for now. Feel free to reopen with more details if further help is required.