Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CoreGraphics.CGWindowListCreateImage() failed when running as a system process.

See original GitHub issue

General information:

  • OS name: macOS Catalina
  • OS version: 10.15
  • OS architecture: 64 bits
  • Resolutions:
    • Monitor 1: 1920x1080
  • Python version: 3.7.3
  • MSS version: 3.2.0

Description of the warning/error

I’m trying to run my python program as a launchd daemon process since its a REST flask app that needs to be running at all times and needs to have the ability to relaunch if the macOS gets rebooted.

One of the endpoints allows me to grab a screenshot of the current monitor. I really like to use your library for the lower level performance… but running as a launchd it seems that this will always fail to create the Image from the CoreGraphics.

CoreGraphics.CGWindowListCreateImage() failed.

Otherwise it works as long as it’s being executed as the user, or even executing sudo on the python script works fine.

Am i missing something with System context and CoreGraphics API’s ?

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

BoboTiGcommented, Sep 6, 2021

I do not have a macOS machine anymore. If someone wants to give a hand, that would be great 😃

ishandutta2007commented, Sep 5, 2021

Same error whenever I run it from cron. Works fine when triggered explicitly from terminal

Read more comments on GitHub >

github_iconTop Results From Across the Web

CGWindowListCreateImage(_:_:_:_:) - Apple Developer
Returns a composite image based on a dynamically generated list of windows. macOS 10.5+ Mac Catalyst 13.1+. Declaration.
Read more >
Capture screenshot of macOS window - Stack Overflow
Screen capture on macOS is possible through Quartz Window Services, a facility of the Core Graphics framework.
Read more >
I made a 'system ran out of application memory' virus by ...
I left my extension running for a while on my Mac, and noticed a 'system ran out of application memory' error and a...
Read more >
Tools/ChangeLog - chromium/blink - Git at Google
Scripts/run-gtk-tests: Ignore files whose name does not start ... [WebWorkers][Chromium] Remove remains of cross-process dedicated worker implementation.
Read more >
How does the (screen) capture work? - Objective-See
Unfortunately, the sound is played very early in the process. ... a function that calls _CGDisplayCreateImage of the CoreGraphics framework.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found