BishopFox/unredacter

Fails to run test (Error: ERR_FAILED (-2) loading)

fduraibi opened this issue · 11 comments

It fails with the default settings/image when pressing the "Click to Start" button

Console output:

[me@fedora unredacter]$ npm start

> unredacter@1.0.0 start
> npm run build && electron ./dist/main.js


> unredacter@1.0.0 build
> tsc

(node:42136) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(node:42175) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
Error occurred in handler for 'redact': Error: ERR_FAILED (-2) loading '  data:text/html;charset=utf-8,   <HTML/>   <body style="padding: 8px 0px 0px 8px; background-color:white;">   <span style="padding 0px 0px 0px 0px; font-weight: normal; line-spacing: 0px; word-spacing: 0px; white-space: pre; margin: 0; font-size: 32px; font-family:'Arial'">a</span><span style="padding 0px 0px 0px 0px; margin: 0; color: blue; font-size: 32px; font-family:'Arial'">█</span>   </body>   </HTML>   '
    at rejectAndCleanup (electron/js2c/browser_init.js:225:1288)
    at WebContents.stopLoadingListener (electron/js2c/browser_init.js:225:1673)
    at WebContents.emit (events.js:223:5) {
  errno: -2,
  code: 'ERR_FAILED',
  url: `  data:text/html;charset=utf-8,   <HTML/>   <body style="padding: 8px 0px 0px 8px; background-color:white;">   <span style="padding 0px 0px 0px 0px; font-weight: normal; line-spacing: 0px; word-spacing: 0px; white-space: pre; margin: 0; font-size: 32px; font-family:'Arial'">a</span><span style="padding 0px 0px 0px 0px; margin: 0; color: blue; font-size: 32px; font-family:'Arial'">█</span>   </body>   </HTML>   `
}

System: Fedora 35

That's weird. Not sure what that error means. Did you run npm install first?

I am also the same problems, i run npm install first. @dan-bishopfox

Looks like the error is in loading the HTML itself. No idea why that would happen, honestly.

@dan-bishopfox yes I did run the install and it worked with no errors

it seems to be an issue when running it inside a sandbox, disable this feature to make it work:

    webPreferences: {
      sandbox: false,

I think the HTML is invalid; This is p00p: <HTML/>.

I think the HTML is invalid; This is p00p: <HTML/>.

Changing that did not help... error is still there

Anyone solved this problem?

@PeanTaster

Anyone solved this problem?

See if this workaround helps: #9 (comment)

샌드박스 내에서 실행할 때 문제가 되는 것 같습니다. 작동하려면 이 기능을 비활성화하세요.

    webPreferences: {
      sandbox: false,

where can I find sandbox?

샌드박스 내에서 실행할 때 문제가 되는 것 같습니다. 작동하려면 이 기능을 비활성화하세요.

    webPreferences: {
      sandbox: false,

where can I find sandbox?

In the main.ts file's 173rd row.
Setting it to false, solved the problem for me.