Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. This application failed to start because no Qt platform plugin could be initialized
Forum Updated to NodeBB v4.3 + New Features

This application failed to start because no Qt platform plugin could be initialized

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 669 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    PaulZ
    wrote on last edited by
    #1

    Re: problem with qt.qpa.plugin: running on a docker in Kubuntu

    Hi. Im trying to run wbots inside the docker container with x11 but getting an error

    docker-compose up webots_simulation                                                         ✔  10980  12:25:26
    [+] Running 1/1
     ✔ Container shatun-webots_simulation-1  Recreated                                                                                                           0.5s
    Attaching to webots_simulation-1
    webots_simulation-1  | Debug: checking directory path "/usr/local/webots/lib/webots/qt/plugins/platforms" ...
    webots_simulation-1  | Debug: looking at "/usr/local/webots/lib/webots/qt/plugins/platforms/libqxcb.so"
    webots_simulation-1  | Debug: Found metadata in lib /usr/local/webots/lib/webots/qt/plugins/platforms/libqxcb.so, metadata=
    webots_simulation-1  | {
    webots_simulation-1  |     "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    webots_simulation-1  |     "MetaData": {
    webots_simulation-1  |         "Keys": [
    webots_simulation-1  |             "xcb"
    webots_simulation-1  |         ]
    webots_simulation-1  |     },
    webots_simulation-1  |     "archlevel": 1,
    webots_simulation-1  |     "className": "QXcbIntegrationPlugin",
    webots_simulation-1  |     "debug": false,
    webots_simulation-1  |     "version": 394240
    webots_simulation-1  | }
    webots_simulation-1  |
    webots_simulation-1  |
    webots_simulation-1  | Debug: Got keys from plugin meta data QList("xcb")
    webots_simulation-1  | Debug: checking directory path "/usr/local/webots/bin/platforms" ...
    webots_simulation-1  | Debug: "/usr/local/webots/lib/webots/qt/plugins/platforms/libqxcb.so" loaded library
    webots_simulation-1  | Warning: could not connect to display host.docker.internal:0
    webots_simulation-1  | Info: Could not load the Qt platform plugin "xcb" in "" even though it was found.
    webots_simulation-1  | Fatal: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
    webots_simulation-1  |
    webots_simulation-1  | Available platform plugins are: xcb.
    webots_simulation-1  |
    webots_simulation-1  | /usr/local/webots/webots: line 105:     9 Aborted                 "$webots_home/bin/webots-bin" "$@"
    webots_simulation-1 exited with code 134
    

    The Dockerfile im using is

    ARG BASE_IMAGE=nvidia/cuda:11.8.0-base-ubuntu22.04
    FROM ${BASE_IMAGE} AS downloader
    
    # Determine Webots version to be used and set default argument
    ARG WEBOTS_VERSION=R2023b
    ARG WEBOTS_PACKAGE_PREFIX=
    
    # Disable dpkg/gdebi interactive dialogs
    ENV DEBIAN_FRONTEND=noninteractive
    
    RUN apt-get update && apt-get install --yes wget bzip2 && rm -rf /var/lib/apt/lists/ && \
     wget https://github.com/cyberbotics/webots/releases/download/$WEBOTS_VERSION/webots-$WEBOTS_VERSION-x86-64$WEBOTS_PACKAGE_PREFIX.tar.bz2 && \
     tar xjf webots-*.tar.bz2 && rm webots-*.tar.bz2
    
    FROM ${BASE_IMAGE}
    
    # Disable dpkg/gdebi interactive dialogs
    ENV DEBIAN_FRONTEND=noninteractive
    
    # Install Webots runtime dependencies
    RUN apt-get update && apt-get install --yes wget xvfb locales && rm -rf /var/lib/apt/lists/ && \
      wget https://raw.githubusercontent.com/cyberbotics/webots/master/scripts/install/linux_runtime_dependencies.sh && \
      chmod +x linux_runtime_dependencies.sh && ./linux_runtime_dependencies.sh && rm ./linux_runtime_dependencies.sh && rm -rf /var/lib/apt/lists/
    
    # Install Webots
    WORKDIR /usr/local
    COPY --from=downloader /webots /usr/local/webots/
    ENV QTWEBENGINE_DISABLE_SANDBOX=1
    ENV WEBOTS_HOME /usr/local/webots
    ENV PATH /usr/local/webots:${PATH}
    
    # Set a user name to fix a warning
    ENV USER root
    
    # Set the locales
    RUN locale-gen en_US.UTF-8
    ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
    
    RUN apt-get update && apt-get install -y '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev 
    
    

    and docker-compose

      webots_simulation:
        build:
          context: .
          dockerfile: Dockerfile_webots_simulation
        volumes:
          - /tmp/.X11-unix:/tmp/.X11-unix
        environment:
          - DISPLAY=host.docker.internal:0
          - QT_DEBUG_PLUGINS=1
          - QT_X11_NO_MITSHM=1
        command: webots
    

    Does anyone can help to understand what is a problem? Running on Mac OS

    jsulmJ 1 Reply Last reply
    0
    • P PaulZ

      Re: problem with qt.qpa.plugin: running on a docker in Kubuntu

      Hi. Im trying to run wbots inside the docker container with x11 but getting an error

      docker-compose up webots_simulation                                                         ✔  10980  12:25:26
      [+] Running 1/1
       ✔ Container shatun-webots_simulation-1  Recreated                                                                                                           0.5s
      Attaching to webots_simulation-1
      webots_simulation-1  | Debug: checking directory path "/usr/local/webots/lib/webots/qt/plugins/platforms" ...
      webots_simulation-1  | Debug: looking at "/usr/local/webots/lib/webots/qt/plugins/platforms/libqxcb.so"
      webots_simulation-1  | Debug: Found metadata in lib /usr/local/webots/lib/webots/qt/plugins/platforms/libqxcb.so, metadata=
      webots_simulation-1  | {
      webots_simulation-1  |     "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
      webots_simulation-1  |     "MetaData": {
      webots_simulation-1  |         "Keys": [
      webots_simulation-1  |             "xcb"
      webots_simulation-1  |         ]
      webots_simulation-1  |     },
      webots_simulation-1  |     "archlevel": 1,
      webots_simulation-1  |     "className": "QXcbIntegrationPlugin",
      webots_simulation-1  |     "debug": false,
      webots_simulation-1  |     "version": 394240
      webots_simulation-1  | }
      webots_simulation-1  |
      webots_simulation-1  |
      webots_simulation-1  | Debug: Got keys from plugin meta data QList("xcb")
      webots_simulation-1  | Debug: checking directory path "/usr/local/webots/bin/platforms" ...
      webots_simulation-1  | Debug: "/usr/local/webots/lib/webots/qt/plugins/platforms/libqxcb.so" loaded library
      webots_simulation-1  | Warning: could not connect to display host.docker.internal:0
      webots_simulation-1  | Info: Could not load the Qt platform plugin "xcb" in "" even though it was found.
      webots_simulation-1  | Fatal: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
      webots_simulation-1  |
      webots_simulation-1  | Available platform plugins are: xcb.
      webots_simulation-1  |
      webots_simulation-1  | /usr/local/webots/webots: line 105:     9 Aborted                 "$webots_home/bin/webots-bin" "$@"
      webots_simulation-1 exited with code 134
      

      The Dockerfile im using is

      ARG BASE_IMAGE=nvidia/cuda:11.8.0-base-ubuntu22.04
      FROM ${BASE_IMAGE} AS downloader
      
      # Determine Webots version to be used and set default argument
      ARG WEBOTS_VERSION=R2023b
      ARG WEBOTS_PACKAGE_PREFIX=
      
      # Disable dpkg/gdebi interactive dialogs
      ENV DEBIAN_FRONTEND=noninteractive
      
      RUN apt-get update && apt-get install --yes wget bzip2 && rm -rf /var/lib/apt/lists/ && \
       wget https://github.com/cyberbotics/webots/releases/download/$WEBOTS_VERSION/webots-$WEBOTS_VERSION-x86-64$WEBOTS_PACKAGE_PREFIX.tar.bz2 && \
       tar xjf webots-*.tar.bz2 && rm webots-*.tar.bz2
      
      FROM ${BASE_IMAGE}
      
      # Disable dpkg/gdebi interactive dialogs
      ENV DEBIAN_FRONTEND=noninteractive
      
      # Install Webots runtime dependencies
      RUN apt-get update && apt-get install --yes wget xvfb locales && rm -rf /var/lib/apt/lists/ && \
        wget https://raw.githubusercontent.com/cyberbotics/webots/master/scripts/install/linux_runtime_dependencies.sh && \
        chmod +x linux_runtime_dependencies.sh && ./linux_runtime_dependencies.sh && rm ./linux_runtime_dependencies.sh && rm -rf /var/lib/apt/lists/
      
      # Install Webots
      WORKDIR /usr/local
      COPY --from=downloader /webots /usr/local/webots/
      ENV QTWEBENGINE_DISABLE_SANDBOX=1
      ENV WEBOTS_HOME /usr/local/webots
      ENV PATH /usr/local/webots:${PATH}
      
      # Set a user name to fix a warning
      ENV USER root
      
      # Set the locales
      RUN locale-gen en_US.UTF-8
      ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
      
      RUN apt-get update && apt-get install -y '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev 
      
      

      and docker-compose

        webots_simulation:
          build:
            context: .
            dockerfile: Dockerfile_webots_simulation
          volumes:
            - /tmp/.X11-unix:/tmp/.X11-unix
          environment:
            - DISPLAY=host.docker.internal:0
            - QT_DEBUG_PLUGINS=1
            - QT_X11_NO_MITSHM=1
          command: webots
      

      Does anyone can help to understand what is a problem? Running on Mac OS

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @PaulZ said in This application failed to start because no Qt platform plugin could be initialized:

      Warning: could not connect to display host.docker.internal:0

      This is the problem.
      Is X11 running when you start the app?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      P 1 Reply Last reply
      1
      • jsulmJ jsulm

        @PaulZ said in This application failed to start because no Qt platform plugin could be initialized:

        Warning: could not connect to display host.docker.internal:0

        This is the problem.
        Is X11 running when you start the app?

        P Offline
        P Offline
        PaulZ
        wrote on last edited by
        #3

        @jsulm yes

        xhost + 127.0.0.1
        

        works to me. Thanks

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved