VJA
VJA

Reputation: 53

EGL Driver message (Error) eglQueryDeviceAttribEXT: Bad attribute

We are getting error below when the chrome browser gets lunched and any view on the issue below where chrome and selenium, python being used:

DevTools listening on ws://127.0.0.1:12306/devtools/browser/14f00afd-581d-4a48-9141-8ab74c3355cf
[1005/210449.408:ERROR:gl_surface_egl.cc(612)] EGL Driver message (Error) eglQueryDeviceAttribEXT: Bad attribute.
[1005/210503.773:ERROR:context_group.cc(151)] ContextResult::kFatalFailure: WebGL2 blacklisted
[1005/210508.959:ERROR:shared_image_manager.cc(120)] SharedImageManager::ProduceGLTexture: Trying to produce a representation from a non-existent mailbox. FB:DB:4B:EB:07:94:DB:D6:D
A:B3:D4:47:9D:AC:5B:83
[1005/210508.960:ERROR:gles2_cmd_decoder.cc(18508)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : DoCreateAndTexStorage2DSharedImageINTERNAL: invalid mailbox name
[1005/210508.960:ERROR:gles2_cmd_decoder.cc(18529)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : DoBeginSharedImageAccessCHROMIUM: bound texture is not a shared image
[1005/210508.961:ERROR:gles2_cmd_decoder.cc(10742)] [.DisplayCompositor]RENDER WARNING: texture bound to texture unit 0 is not renderable. It might be non-power-of-2 or have incomp
atible texture filtering (maybe)?
[1005/210508.962:ERROR:gles2_cmd_decoder.cc(18552)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : DoEndSharedImageAccessCHROMIUM: bound texture is not a shared image
[1005/210509.027:ERROR:gles2_cmd_decoder.cc(18529)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : DoBeginSharedImageAccessCHROMIUM: bound texture is not a shared image
[1005/210509.028:ERROR:gles2_cmd_decoder.cc(10742)] [.DisplayCompositor]RENDER WARNING: texture bound to texture unit 0 is not renderable. It might be non-power-of-2 or have incomp
atible texture filtering (maybe)?
[1005/210509.028:ERROR:gles2_cmd_decoder.cc(18552)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : DoEndSharedImageAccessCHROMIUM: bound texture is not a shared image
[1005/210509.673:ERROR:gles2_cmd_decoder.cc(18529)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : DoBeginSharedImageAccessCHROMIUM: bound texture is not a shared image
[1005/210509.674:ERROR:gles2_cmd_decoder.cc(10742)] [.DisplayCompositor]RENDER WARNING: texture bound to texture unit 0 is not renderable. It might be non-power-of-2 or have incomp
atible texture filtering (maybe)?
[1005/210509.674:ERROR:gles2_cmd_decoder.cc(18552)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : DoEndSharedImageAccessCHROMIUM: bound texture is not a shared image
10/05/2019 09:05:16 PM ama-cloude webtext:alexa what time is it in hong kong , It's 6:50am.

Code trials:

import platform , logging
import os,re
from time import  sleep
import selenium.webdriver.support.ui as ui
import selenium.webdriver.support.expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.webdriver import WebDriver
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.action_chains import ActionChains

class Cloud(object):
    """
    Amazon cloud class to get query and response for alexa
    """

    def __init__(self, username='xxxxxxxx', password='xxxx'):

        logging.basicConfig(format='%(asctime)s %(message)s', datefmt='%m/%d/%Y %I:%M:%S %p', level=logging.INFO)
        self.logger = logging.getLogger(__name__)

        self.url = "https://www.amazon.com"
        self.username = username
        self.password = password
        self.timeout = 100
        self.driver = None
        self.get_chrome_driver()

    def get_chrome_driver(self):
        """
        get chrome driver
        """
        if platform.system().lower() == 'windows':
            if self.driver is None:
                chrome_options = Options()
                #chrome_options.add_argument('--disable-extensions')
                chrome_options.add_argument('--start-maximized')
                chrome_options.add_argument('--disable-popup-blocking')
                chrome_options.add_argument('--ignore-certificate-errors')
                chrome_options.add_argument('--allow-insecure-localhost')
                chrome_options.add_argument('--disable-infobars')
                chrome_options.add_argument("--log-level=3")
                chrome_driver_path = os.path.join(str(os.environ['PYTHONPATH'].split(';')[0]),"bin","chromedriver","chromedriver.exe")
                self.driver = WebDriver(executable_path=chrome_driver_path, chrome_options=chrome_options)
        return self.driver

    def login(self, username='xxxxxxxxx', password='xxxxx'):
        """
        Login into amazon cloud
        """
        self.logger.info("logging in amazon cloud username: %s and password: %s" %(self.username, re.sub(r".", "*", self.password)))
        self.driver.get(self.url)
        # wait for login username textbox

        self.wait_visibility_element(By.XPATH, "//div[@id='nav-signin-tooltip']//span[@class='nav-action-inner'][contains(text(),'Sign in')]")
        self.driver.find_element_by_xpath("  //div[@id='nav-signin-tooltip']//span[@class='nav-action-inner'][contains(text(),'Sign in')]").click()

        self.wait_visibility_element(By.XPATH,"//label[@class='a-form-label']")

        self.wait_visibility_element(By.XPATH,"//input[@id='ap_email']")
        username_textbox = self.driver.find_element_by_xpath("//input[@id='ap_email']")
        username_textbox.clear()
        username_textbox.send_keys(self.username)  
        self.driver.find_element_by_xpath("//input[@id='continue']").click() 
        self.wait_visibility_element(By.XPATH,"//input[@id='ap_password']")  #//label[@class='a-form-label']

        password_textbox = self.driver.find_element_by_xpath("//input[@id='ap_password']")
        password_textbox.clear()
        password_textbox.send_keys(self.password)
        # click on submit button
        self.driver.find_element_by_xpath("//input[@id='signInSubmit']").click()


    def wait_visibility_element(self, by_type, element_name):
        """
        wait for visibility of element
        :param by_type: Locate element using type of element
        :param element_name: element name
        """
        ui.WebDriverWait(self.driver, self.timeout).until(
            EC.visibility_of_element_located((by_type, element_name)))

Upvotes: 4

Views: 8415

Answers (2)

jeffsui
jeffsui

Reputation: 29

Disabling gpu on chrome solved this error.

from selenium import webdriver
chrome_opt = webdriver.ChromeOptions()
chrome_opt.add_argument('--disable-gpu')
path = r"D:/tools/chromedriver/chromedriver.exe"
driver = webdriver.Chrome(executable_path=path,chrome_options=chrome_opt)
...

rerunning the script with the above options did not cause the above error message.

Upvotes: 2

undetected Selenium
undetected Selenium

Reputation: 193298

This error message...

ERROR:gl_surface_egl.cc(668)] EGL Driver message (Error) eglQueryDeviceAttribEXT: Bad attribute.

...is defined in gl_surface_egl.cc as follows:

static void EGLAPIENTRY LogEGLDebugMessage(EGLenum error,
                       const char* command,
                       EGLint message_type,
                       EGLLabelKHR thread_label,
                       EGLLabelKHR object_label,
                       const char* message) {
  std::string formatted_message = std::string("EGL Driver message (") +
                  GetDebugMessageTypeString(message_type) +
                  ") " + command + ": " + message;

Deep Dive

As per the documentation in List of Chromium Command Line Switches the argument --use-gl selects which implementation of GL the GPU process should be used and the available options are:

  • desktop: whatever desktop OpenGL the user has installed (Linux and Mac default).
  • egl: whatever EGL / GLES2 the user has installed (Windows default - actually ANGLE).
  • swiftshader: The SwiftShader software renderer.

This DEBUG message is not harmful and you can continue with your tests.


Solution

However as per best practices, if your usecase involves invoking click() instead of using visibility_of_element_located() you need to induce WebDriverWait for the element_to_be_clickable() as follows:

def wait_clickability_element(self, by_type, element_name):
    """
    wait for clickability of element
    :param by_type: Locate element using type of element
    :param element_name: element name
    """
    ui.WebDriverWait(self.driver, self.timeout).until(
        EC.element_to_be_clickable((by_type, element_name)))

Additional consideration

Possibly this error is caused by the app getting launched by ES2-only devices, even though the manifest requires ES3 capability. Updating EGL_RENDERABLE_TYPE from EGL_OPENGL_ES2_BIT to EGL_OPENGL_ES3_BIT will solve this issue.

Upvotes: 2

Related Questions