You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "arnabneogi86 (via GitHub)" <gi...@apache.org> on 2024/03/04 09:52:08 UTC

[I] Cant take screenshot: 'chromedriver' executable may have wrong permissions. [superset]

arnabneogi86 opened a new issue, #27374:
URL: https://github.com/apache/superset/issues/27374

   ### Bug description
   
   Hi,
   I'm running superset from docker image: apache/superset:4.0.0rc1
   In the Dockerfile, I'm running the following for the chromedriver
   ```
   USER root
   RUN apt-get update && \
       wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && \
       apt-get install -y --no-install-recommends ./google-chrome-stable_current_amd64.deb && \
       rm -f google-chrome-stable_current_amd64.deb
   
   
   RUN export CHROMEDRIVER_VERSION="122.0.6261.94" && \
       wget -O chromedriver_linux64.zip https://storage.googleapis.com/chrome-for-testing-public/122.0.6261.94/linux64/chromedriver-linux64.zip
   
   
   RUN unzip chromedriver_linux64.zip -d /usr/bin && \
       mv /usr/bin/chromedriver-linux64 /usr/bin/chromedriver && \
       chmod 755 /usr/bin/chromedriver && \
       rm -f chromedriver_linux64.zip
   RUN pip install --no-cache gevent psycopg2 redis`
   USER superset
   
   ```
   The above part is the last bit of my Dockerfile to install the chromedriver and assigning it 755 access. 
   This makes reports and alerts run in superset but showing error access issue:
   ![image](https://github.com/apache/superset/assets/45539031/0d6516cb-0650-42d3-97e5-8088db48ab94)
   
   This is the error from superset container:
   
   Traceback (most recent call last):
   ```
     File "/app/superset/tasks/scheduler.py", line 90, in execute
       AsyncExecuteReportScheduleCommand(
     File "/app/superset/commands/report/execute.py", line 727, in run
       raise ex
     File "/app/superset/commands/report/execute.py", line 723, in run
       ReportScheduleStateMachine(
     File "/app/superset/commands/report/execute.py", line 684, in run
       state_cls(
     File "/app/superset/commands/report/execute.py", line 588, in next
       raise first_ex
     File "/app/superset/commands/report/execute.py", line 557, in next
       self.send()
     File "/app/superset/commands/report/execute.py", line 456, in send
       notification_content = self._get_notification_content()
     File "/app/superset/commands/report/execute.py", line 361, in _get_notification_content
       screenshot_data = self._get_screenshots()
     File "/app/superset/commands/report/execute.py", line 240, in _get_screenshots
       raise ReportScheduleScreenshotFailedError(
   superset.commands.report.exceptions.ReportScheduleScreenshotFailedError: Failed taking a screenshot Message: 'chromedriver' executable may have wrong permissions. Please see https://sites.google.com/a/chromium.org/chromedriver/home
    value of use admin for user = Admin Admin
   ```
   
   Note:
   
   I'm running celery in the same container:
   ```
   celery --app superset.tasks.celery_app:app worker --pool=prefork --max-tasks-per-child=128 -O fair &
   celery --app=superset.tasks.celery_app:app beat --pidfile /tmp/celerybeat.pid --schedule /tmp/celerybeat-schedule --loglevel DEBUG
   
   ```
   
   
   ### How to reproduce the bug
   
   1. run FROM apache/superset:4.0.0rc1 as base as Dockerfile base image
   2. Run the followng commands
   ```
   USER root
   RUN superset fab create-admin \
       --username admin \
       --firstname Admin \
       --lastname Admin \
       --email admin@localhost \
       --password admin
   RUN superset db upgrade
   
   RUN superset init 
   RUN mkdir -p /usr/share/oracle/network/admin \
       && cd /usr/share/oracle \
       && apt-get update -y \
       && apt-get install -y --no-install-recommends git ca-certificates wget build-essential unzip curl libaio1 libaio-dev \
       && rm -rf /var/lib/apt/lists/* \
       && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
       && wget https://download.oracle.com/otn_software/linux/instantclient/instantclient-basiclite-linuxx64.zip \
       && unzip instantclient-basiclite-linuxx64.zip \
       && rm -f instantclient-basiclite-linuxx64.zip \
       && cd  /usr/share/oracle/instantclient* \
       && rm -f *jdbc* *occi* *mysql* *README *jar uidrvci genezi adrci \
       && echo  /usr/share/oracle/instantclient* > /etc/ld.so.conf.d/oracle-instantclient.conf \
       && ldconfig 
   USER superset
   ```
   3. In the celery worker, run the celery node:
   ```
   celery --app superset.tasks.celery_app:app worker --pool=prefork --max-tasks-per-child=128 -O fair &
   celery --app=superset.tasks.celery_app:app beat --pidfile /tmp/celerybeat.pid --schedule /tmp/celerybeat-schedule --loglevel DEBUG
   ```
   4. Create an alert and report. You can see the alert/report running. But error in activity
   ![image](https://github.com/apache/superset/assets/45539031/0c057cf1-6112-4955-8e8c-291fddf42dae)
   ![image](https://github.com/apache/superset/assets/45539031/9cd6fdc0-6cc4-40c9-9d1b-f6c2ceb3684a)
   
   
   ### Screenshots/recordings
   
   _No response_
   
   ### Superset version
   
   master / latest-dev
   
   ### Python version
   
   3.9
   
   ### Node version
   
   16
   
   ### Browser
   
   Chrome
   
   ### Additional context
   
   _No response_
   
   ### Checklist
   
   - [X] I have searched Superset docs and Slack and didn't find a solution to my problem.
   - [X] I have searched the GitHub issue tracker and didn't find a similar bug report.
   - [X] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] Cant take screenshot: 'chromedriver' executable may have wrong permissions. [superset]

Posted by "locobuzz-pushpendra (via GitHub)" <gi...@apache.org>.
locobuzz-pushpendra commented on issue #27374:
URL: https://github.com/apache/superset/issues/27374#issuecomment-1999562456

   Hey,I also facing the same issue,Can you please help me for this issue?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] Cant take screenshot: 'chromedriver' executable may have wrong permissions. [superset]

Posted by "arnabneogi86 (via GitHub)" <gi...@apache.org>.
arnabneogi86 commented on issue #27374:
URL: https://github.com/apache/superset/issues/27374#issuecomment-1976858102

   After spending 2 days in debugging it seems alerts are working now.
   It is a bug in webdriver for chrome.
   Need to add the following arg in options:
   options.add_argument('--remote-debugging-pipe')
   Refer:  https://bugs.chromium.org/p/chromedriver/issues/detail?id=4403#c35
   
   This needs to be added in /app/superset/utils/webdriver.py line 258
    ```
          elif self._driver_type == "chrome":
               driver_class = chrome.webdriver.WebDriver
               options = chrome.options.Options()
               options.add_argument(f"--force-device-scale-factor={pixel_density}")
               options.add_argument('--remote-debugging-pipe')
               options.add_argument("--disable-extensions")
               options.add_argument(f"--window-size={self._window[0]},{self._window[1]}")
               kwargs = {"options": options}
   ```
   
   2nd Issue:
   Chromedriver not having right access:
   Put chromedriver file in /usr/bin and not in folder /usr/bin/chromedriver
   Give 755 access to chromedriver
   Here is the dockerfile
   ```
   RUN export CHROMEDRIVER_VERSION="122.0.6261.94" && \
       wget -O chromedriver_linux64.zip https://storage.googleapis.com/chrome-for-testing-public/122.0.6261.94/linux64/chromedriver-linux64.zip
   
   RUN unzip chromedriver_linux64.zip -d /usr/bin && \
       mv /usr/bin/chromedriver-linux64/chromedriver /usr/bin && \
       chmod 755 /usr/bin/chromedriver && \
       rm -f chromedriver_linux64.zip
   
   RUN pip install --no-cache gevent psycopg2 redis
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] Cant take screenshot: 'chromedriver' executable may have wrong permissions. [superset]

Posted by "arnabneogi86 (via GitHub)" <gi...@apache.org>.
arnabneogi86 closed issue #27374: Cant take screenshot:  'chromedriver' executable may have wrong permissions.
URL: https://github.com/apache/superset/issues/27374


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org