filprofiler icon indicating copy to clipboard operation
filprofiler copied to clipboard

Spurious error message when opening browser on macOS

Open cheshrkat opened this issue 3 years ago • 6 comments

I'm getting an error message after running fil-profile in OSX Terminal (bash):

0:94: execution error: File some object wasn’t found. (-43)

As a minimal test case, I can reproduce this by following the getting started demo at https://pythonspeed.com/fil/docs/fil/getting-started.html which produces this result:

$ fil-profile run testfil.py 
=fil-profile= Memory usage will be written out at exit, and opened automatically in a browser.
=fil-profile= You can also run the following command while the program is still running to write out peak memory usage up to that point: kill -s SIGUSR2 72175
=fil-profile= Preparing to write to fil-result/2022-03-15T18:43:37.577
=fil-profile= Wrote flamegraph to "fil-result/2022-03-15T18:43:37.577/peak-memory.svg"
=fil-profile= Wrote flamegraph to "fil-result/2022-03-15T18:43:37.577/peak-memory-reversed.svg"
=fil-profile= Wrote HTML report to fil-result/2022-03-15T18:43:37.577/index.html
0:94: execution error: File some object wasn’t found. (-43)

The report does open and looks about right according to the demo (this was my first time using Fil so I'm not super sure :))

I reproduced against python 3.10.2 and 3.8.12 (both installed with pyenv). This is on MacOS Big Sur 11.6.4. Don't have a Monterey machine handy to test that.

I saw some references to this perhaps needing a browser environmental variable, but setting that didn't silence the error. Obviously since it does appear to be working this isn't the end of the world, but it would still be nice to figure out how to fix it :)

cheshrkat avatar Mar 15 '22 07:03 cheshrkat

That's not a real error, that's just Python trying to open browsers one by one until it finds one that works. So you don't have to worry about it. Fil should at least say "please ignore any error messages beyond this point, it's noise", or something.

itamarst avatar Mar 15 '22 13:03 itamarst

And thank you for reporting this! it's useful to know people find this disconcerting.

itamarst avatar Mar 15 '22 13:03 itamarst

Thanks for the update :) I raised this partly because I'm likely to roll this out to a bigger group, and needed to log messages about "ignore that error" as they definitely get worried if they see errors. So yeah as you say, it's benign but disconcerting.

cheshrkat avatar Mar 17 '22 01:03 cheshrkat

For now adding a warning. Switching to Rust's https://docs.rs/webbrowser/ is a longer-term solution, since it allows suppressing the noise.

itamarst avatar Mar 27 '22 15:03 itamarst

The workaround will be in v2022.3.0, which I hope to release today or tomorrow.

itamarst avatar Mar 27 '22 15:03 itamarst

Thanks! :)

cheshrkat avatar Mar 28 '22 08:03 cheshrkat