BishopFox / unredacter

Never ever ever use pixelation as a redaction technique
GNU General Public License v3.0
7.81k stars 729 forks source link

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

Open fduraibi opened 2 years ago

fduraibi commented 2 years ago

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

dan-bishopfox commented 2 years ago

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

yangxin325 commented 2 years ago

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

dan-bishopfox commented 2 years ago

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

fduraibi commented 2 years ago

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

fduraibi commented 2 years ago

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

    webPreferences: {
      sandbox: false,
royarisse commented 2 years ago

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

w3ich3rt commented 2 years ago

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

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

PeanTaster commented 2 years ago

Anyone solved this problem?

fduraibi commented 1 year ago

@PeanTaster

Anyone solved this problem?

See if this workaround helps: https://github.com/BishopFox/unredacter/issues/9#issuecomment-1048554671

6iioii9 commented 1 year ago

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

    webPreferences: {
      sandbox: false,

where can I find sandbox?

zcsernak commented 1 year ago

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

    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.