Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] error code: STATUS_INVALID_IMAGE_HASH #4659

Closed
zhuoqinyue opened this issue Jul 13, 2022 · 19 comments
Closed

[bug] error code: STATUS_INVALID_IMAGE_HASH #4659

zhuoqinyue opened this issue Jul 13, 2022 · 19 comments
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@zhuoqinyue
Copy link

Describe the bug

I'm not sure if tauri is responsible for this error, as follow:
image

but I can open this page in my browser, as follow:
image

Reproduction

The command I executed is as follows

  1. npx create-react-app tauriapp
  2. yarn add -D @tauri-apps/cli cross-env
  3. yarn add -D mini-css-extract-plugin
  4. yarn build
  5. yarn tauri init
  6. yarn add @tauri-apps/api
  7. yarn build
  8. yarn tauri dev

Expected behavior

I reinstalled Edge and edge's WebView, but this didn't work.
I've tried every solution on the web to solve the "error code: STATUS_INVALID_IMAGE_HASH" problem, but nothing works

Platform and versions

Environment
  › OS: Windows 10.0.19044 X64
  › Webview2: 103.0.1264.49
  › MSVC:
      - Visual Studio Community 2022
  › Node.js: 14.18.0
  › npm: 6.14.15
  › pnpm: Not installed!
  › yarn: 1.22.17
  › rustup: 1.24.3
  › rustc: 1.62.0
  › cargo: 1.62.0
  › Rust toolchain: stable-x86_64-pc-windows-msvc

Stack trace

No response

Additional context

No response

@zhuoqinyue zhuoqinyue added status: needs triage This issue needs to triage, applied to new issues type: bug labels Jul 13, 2022
@zhuoqinyue
Copy link
Author

I forgot something.
environment and platform:

Environment
  › OS: Windows 10.0.19044 X64
  › Webview2: 103.0.1264.49
  › MSVC: 
      - Visual Studio Community 2022
  › Node.js: 14.18.0
  › npm: 6.14.15
  › pnpm: Not installed!
  › yarn: 1.22.17
  › rustup: 1.25.1
  › rustc: 1.62.0
  › cargo: 1.62.0
  › Rust toolchain: stable-x86_64-pc-windows-msvc 

Packages
  › @tauri-apps/cli [NPM]: 1.0.3
  › @tauri-apps/api [NPM]: 1.0.2
  › tauri [RUST]: 1.0.3,
  › tauri-build [RUST]: 1.0.3,
  › tao [RUST]: 0.12.1,
  › wry [RUST]: 0.19.0,

App
  › build-type: bundle
  › CSP: unset
  › distDir: ../build
  › devPath: http://localhost:3000/
  › framework: React

App directory structure
  ├─ .git
  ├─ build
  ├─ node_modules
  ├─ public
  ├─ src
  └─ src-tauri
Done in 13.19s.

@CliffHan
Copy link

CliffHan commented Aug 3, 2022

I met the same error when trying to run a default demo on windows.

yarn create tauri-app
cd tauri-app
yarn install
yarn tauri dev

And I got the 1st picture just in this post.

@FabianLars
Copy link
Sponsor Member

@CliffHan Can you add the output of yarn tauri info too? Thanks.

And on the issue itself, i have no idea how to reproduce it and resources on the internet are really not that helpful :/

@nothingismagick
Copy link
Sponsor Member

Wow, this is a weird one that seems to have a wide range of potential causes.

I found this to have a pretty good explanation:
https://textslashplain.com/2019/09/27/aw-snap-every-tab-crashes/

What antivirus software are you running?

@nothingismagick
Copy link
Sponsor Member

I would also point out, that WebView2 is very obviously signed by MS.

@CliffHan
Copy link

CliffHan commented Aug 3, 2022

@CliffHan Can you add the output of yarn tauri info too? Thanks.

And on the issue itself, i have no idea how to reproduce it and resources on the internet are really not that helpful :/

The problem happens on my PC in my comany, and it didn't happens on my PC at home.
And I'm home now. So, maybe tomorrow, I'll post the tauri info.

I guess it's caused by some third-party modules loaded by edge.
I could see some unfamiliar modules when I open the "edge://conflicts/#" url in edge.
But I don't know how to disable those to make edge works normally.

@CliffHan
Copy link

CliffHan commented Aug 4, 2022

@FabianLars

Here's tauri info output:

yarn run v1.22.15
warning package.json: No license field
$ tauri info

Environment
  › OS: Windows 10.0.22000 X64
  › Webview2: 103.0.1264.77
  › MSVC:
      - Visual Studio Community 2022
  › Node.js: 16.16.0
  › npm: 8.11.0
  › pnpm: 6.11.0
  › yarn: 1.22.15
  › rustup: 1.25.1
  › rustc: 1.62.1
  › cargo: 1.62.1
  › Rust toolchain: stable-x86_64-pc-windows-msvc

Packages
  › @tauri-apps/cli [NPM]: 1.0.5
  › @tauri-apps/api [NPM]: 1.0.2
  › tauri [RUST]: 1.0.5,
  › tauri-build [RUST]: 1.0.4,
  › tao [RUST]: 0.12.2,
  › wry [RUST]: 0.19.0,

App
  › build-type: bundle
  › CSP: unset
  › distDir: ../dist
  › devPath: ../dist

App directory structure
  ├─ dist
  ├─ node_modules
  └─ src-tauri
Done in 27.23s.

Now I don't think this problem is directly caused by tauri. Maybe it's caused by some hook dll which were not published by Microsoft.

Here's modules loaded on the problematic PC.

Snipaste_2022-08-04_09-36-00

Is there's any "safe mode" for tauri to call the webview2?

@CliffHan
Copy link

CliffHan commented Aug 4, 2022

Looks like it's caused by this software: "ocular agent v3", required to install by my company, and cannot easily be uninstalled.

@CliffHan
Copy link

CliffHan commented Aug 4, 2022

confirmed, in my case, event viewer reported this error:

Code Integrity determined that a process (\Device\HarddiskVolume5\Program Files (x86)\Microsoft\EdgeWebView\Application\103.0.1264.77\msedgewebview2.exe) attempted to load \Device\HarddiskVolume5\Windows\System32\winhafnt64.dll that did not meet the Microsoft signing level requirements.

and this error caused tauri-app hang:

程序 tauri-app.exe 版本 0.1.0.0 已停止与 Windows 交互并关闭。若要查看是否有关于该问题的详细信息,请检查“安全性与维护”控制面板中的问题历史记录。
 进程 ID: 44a0
 开始时间: 01d8a7afb8bef180
 终止时间: 4294967295
 应用程序路径: D:\Workspace\tauri-app\src-tauri\target\debug\tauri-app.exe
 报告 ID: 9906b614-3810-44ca-bbdf-7a4cad037950
 错误程序包全名: 
 错误程序包相关应用程序 ID: 
 挂起类型: Top level window is idle

So, again, although it's caused by a unexpected third-party module, is there some way to explictly disable loading such third-party modules when tauri starts webview2?

@lucasfernog
Copy link
Member

Seems like there's nothing we can do @CliffHan MicrosoftEdge/WebView2Feedback#2051

@CliffHan
Copy link

CliffHan commented Aug 4, 2022

Seems like there's nothing we can do @CliffHan MicrosoftEdge/WebView2Feedback#2051

No way to disable webview2 from loading that? Sad news.
Or maybe you could report an error to avoid tauri-app hanging there when met such errors, that should be a enhancement.
Anyway, thank you for your work. You're doing a great job.

@zhuoqinyue
Copy link
Author

I don't know why I have been opening this 'issue' for so many days and no one has replied to me.
It is only today that the developers involved are following up because others are in the same situation
What a disgusting experience! @lucasfernog

@lucasfernog
Copy link
Member

@CliffHan I don't think webview2 exposes a way for us to detect such error :(

@nothingismagick
Copy link
Sponsor Member

@zhuoqinyue - please consider the tone of your message. I understand where your frustration comes from, but we - as with every other open-source community - try to maintain an inclusive and friendly conversation. If you feel that you were intentionally ignored, I can assure you that this is not the case. All of us are very busy. Looking at your github history, it seems as if you have not been very active in open source, and also that English is perhaps not your first language. As a moderator (and cofounder of Tauri), I am willing to let this incident slide without reporting it to GitHub, under the expectation that you make an apology.

For your reference, please refer to our CODE OF CONDUCT:

https://github.com/tauri-apps/tauri/blob/dev/.github/CODE_OF_CONDUCT.md

@zhuoqinyue
Copy link
Author

zhuoqinyue commented Aug 4, 2022 via email

@FabianLars
Copy link
Sponsor Member

Sorry that you felt ignored but the truth is, we had no idea what the issue was or how to approach it in general. And as you can see, it was solved by another user with the same problem, so in the end, we still didn't really do anything to help😅Well, other than saying that we seemingly can't fix it ourselves :/

@CliffHan
Copy link

CliffHan commented Aug 4, 2022

@zhuoqinyue I think I understand why tauri developers didn't answer your question at first.
That's a problem caused by the environment, not tauri itself. They just cannot reproduce that problem.
I think that's normal. Open source project maintainers don't have obligation to answer all user's question.

In my case, I tested with different environment, and got different result.
Then I learned a lot from links provided by @nothingismagick and @lucasfernog (thanks them BTW).
Then I found the root cause, and solved it this afternoon, by asking my network admin to tweak some policies.

I think you could click into the windows event viewer to get closer to your root cause.
If you still need help, you could post here, even mail me if you like. I'm willing to help.

@zhuoqinyue
Copy link
Author

Thank you very much, I'd love to communicate with you too.
I hope this problem can be resolved so that I can continue to experience the different feelings tauri has given me during development. @CliffHan
And thanks all. @nothingismagick @CliffHan @lucasfernog

@JieyueCoding
Copy link

My side is also caused by security software.
Applications that have been built can be resolved by modifying the compatibility of the software mentioned above.
If it is a development environment, you need to find "msedgewebview2.exe", change its compatibility to solve
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug
Projects
None yet
Development

No branches or pull requests

6 participants