# 故障排除

Source: [https://docs.qualcomm.com/doc/80-70014-254Y/topic/troubleshoot_sync_build_and_flash.html](https://docs.qualcomm.com/doc/80-70014-254Y/topic/troubleshoot_sync_build_and_flash.html)

### Docker

- ***docker：无法连接到 unix:///var/run/docker.sock 上的 Docker 后台程序。Docker 后台程序是否正在运行？***
运行以下命令启动 Docker：

        sudo systemctl start dockerCopy to clipboard
- ***后台程序的错误响应：Get "https://registry-1.docker.io/v2/"：http: server gave HTTP response to HTTPS client***
添加内部 Docker 注册表镜像（Qualcomm 网络内部设置）。
Note: 
                            
不要在 JSON 配置文件中包含 # 注释。

使用制表符代替空格和其他不可见的空白字符可能会破坏 JSON 配置文件的正常工作，并且可能导致 `docker.service` 无法启动。

        sudo vim /etc/docker/daemon.json
        # Add an entry similar to the following in /etc/docker/daemon.json:
        {
                "registry-mirrors": ["https://docker-registry.qualcomm.com"]
        }Copy to clipboard

重新启动 Docker 服务以应用新的设置。

        sudo systemctl restart dockerCopy to clipboard
- ***由于未启用虚拟化，Docker 失败***
可以通过从 BIOS 启用虚拟化来解决此错误。按照系统提供商的具体说明启用虚拟化。例如，以下步骤可以启用系统提供商提供的虚拟化：
    1. 当系统启动时，进入 BIOS。随即会显示 BIOS 窗口。
    2. 切换到 Advanced 选项卡。
    3. 在 CPU Configuration 部分中，启用 Virtualization Technology。
    4. 保存并退出。
    5. 重新启动系统。
- ***尝试连接到 unix:///var/run/docker.sock 上的 Docker 后台程序套接字时权限被拒绝***
当机器上已安装 `qsc-cli`，并且用户不属于 Docker 组时，会发生这种情况：

        sudo usermod -aG docker $USER
        newgrp dockerCopy to clipboard

要确认用户是否属于 Docker 组，可运行以下命令：

        sudo grep /etc/group -e "docker"
        # This command shows a list of users who are part of the Docker group; must include your user IDCopy to clipboard

退出并重新登录以使访问权限生效。

        # You can run the following command to check if you are part of the Docker group
        id -a
        # This command returns an output string which should include 'docker'Copy to clipboard

### 同步

- ***repo init 或 sync 失败时，出现“except ManifestInvalidRevisionError, e”报错：***
安装 Repo 软件包后，如果出现以下情况，则可能会遇到此问题：
    - 在 `/etc/gitconfig` 或 `~/.gitconfig` 中有到内部镜像的重定向。
    - 内部镜像在映射时有分支前缀。

例如，如果 `/etc/gitconfig` 重定向，并且内部镜像具有来自上游 git 的映射到 `aosp/stable` 的稳定分支，则在执行 `repo init` 时，会显示以下错误：

        [url "ssh://<internal mirror>:<port>/tools/repo"]
          insteadOf = https://android.googlesource.com/tools/repo
          insteadOf = https://gerrit.googlesource.com/git-repoCopy to clipboard

        File "/local/mnt/workspace/<userid>/test_repo/.repo/repo/main.py", line 126
            except ManifestInvalidRevisionError, e: 
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        SyntaxError: multiple exception types must be parenthesizedCopy to clipboard

解决此错误的步骤如下：

        # Remove the older .repo folder. This will be in the directory where you ran 'repo init' command earlier
        rm -rf .repo
         
        # Export and run the repo commands to fix the repo issues. The REPO_REV must point to the mirrored
        # branch from upstream 'stable' branch of https://gerrit.googlesource.com/git-repo
        export REPO_REV='aosp/stable'Copy to clipboard
- ***安装 repo 时显示“Server certificate verification failed”***
如果显示证书错误，例如“Server certificate verification failed.CAfile: none CRLfile: none”，则使用 git 配置将 git 配置为禁用 SSL 证书验证。咨询 IT 管理部门，以获取进一步的指导。您可以使用以下任一命令来禁用 SSL：

        export GIT_SSL_NO_VERIFY=1
        git config --global http.sslverify falseCopy to clipboard

如果您所在的地区禁止访问 `android.googlesource`，可尝试以下配置以从 Codelinaro 镜像获取 Repo：

        git config --global url.https://git.codelinaro.org/clo/la/tools/repo.insteadOf https://android.googlesource.com/tools/repoCopy to clipboard
- ***error.GitError: git config ('--replace-all', 'color.ui', 'auto'): error: could not write config file /home/$USER/.gitconfig： Device or resource busy***
当您的 gitconfig 没有设置 UI 颜色配置时，就会出现此错误。Git 1.8.4 及更高版本会默认设置此配置。运行以下命令，以在您的帐户中启用彩色显示：

        git config --global color.ui autoCopy to clipboard
- ***[Error]: Failed preparing build for compilation.Error: Error setting docker credentials.Error: "Error saving credentials: error closing temp file: close /usr2/&lt;userid&gt;/.docker/config.json3322274803: disk quato exceeded\n"***
    QSC CLI 在 home 目录中只使用几千字节 (kB)。从 home 目录中清理出几兆字节 (MB) 的空间。
- ***[Error]: The "path" argument must be of type string.Received undefined***
**错误摘录**

        qsc-cli download --workspace-path '/local/mnt/workspace/<userid>/K2L/QSC_CLI_BUILD/build' --product 'QCM6490.LE.1.0' --build 'QCM6490.LE.1.0-00134-STD.PROD-1' --distribution 'Qualcomm_Linux.SPF.1.0|TEST|DEVICE|PUBLIC'
        [Info]: Starting qsc-cli version 0.0.0.7 
        (node:2924765) ExperimentalWarning: The Fetch API is an experimental feature.This feature could change at any time
        (Use `qsc-cli --trace-warnings ...` to show where the warning was created)
        [Info]: Checking if Workspace already exists
        [Info]: Saved updated Workspace info
        [Info]: Workspace Setup Completed
        [Error]: The "path" argument must be of type string.Received undefinedCopy to clipboard

    **解决方案**

发生此错误的原因是 QSC-CLI 与 Qlauncher 不兼容。Qlauncher 即将被弃用，并由 QSC 的新程序替代。如果您的工作区中有 Qlauncher，则可以运行以下命令：

        # Find your workspace within the Qlauncher UI
        # Take a backup of the following metadata file if you want to preserve the older workspace created with Qlauncher.
        # These will work only with Qlauncher app. You can reinstall the app at a later time again to access. If you do not 
        # need the workspaces, you can delete this file using:
        mv /var/lib/qcom/data/qualcomm_launcher/workspaces2.json /var/lib/qcom/data/qualcomm_launcher/workspaces2.json.bak
        # Uninstall Qlauncher with the following command:
        qpm-cli --uninstall qualcomm_launcherCopy to clipboard
- ***docker：Error response from daemon: error while creating mount source path '/usr2/&lt;userid&gt;/.netrc': mkdir /usr2/&lt;userid&gt;/.netrc: permission denied***
**错误摘录**

        Updating files: 100% (64/64), done.
        2024-02-29T07:58:00: Sync Command Completed
        2024-02-29T07:58:01: Finished setup.
        [Info]: Setting Docker Credential
        2024-02-29T07:58:03: Authorization successful
        2024-02-29T07:58:03: Sync Command Starting
        2024-02-29T07:58:03: Running Sync Command for SyncOpenSourceCode - DownloadOpenSource
        docker: Error response from daemon: error while creating mount source path '/usr2/ramevelp/.netrc': mkdir /usr2/ramevelp/.netrc: permission denied.
        2024-02-29T07:58:04: Sync Command Failed
        [Error]: Failed SP Download with error: 2024-02-29T07:58:04: Sp Download failed.ExitCode: 126 Signal: 0  with errorcode 4
        [Error]: 2024-02-29T07:58:04: Sp Download failed.ExitCode: 126 Signal: 0Copy to clipboard

    **解决方案**

    这可能是由于 IT 设置 home 目录的方式所致。请与 IT 管理员合作，对 home 目录进行任何进一步的更改。
- ***fatal: couldn't find remote ref refs/heads/qcom-linux<sub class="ph sub">STX</sub>kirkstone***
    如果在从 PDF 复制命令时看到任何垃圾字符，删除这些垃圾字符或将其替换为适当的符号，然后重新运行该命令。或者，您可以以 HTML 模式打开指南并使用复制命令选项。

    **示例**

        # Replace the following command
        repo init -u https://github.com/quic-yocto/qcom-manifest -b qcom-linuxSTXkirkstone -m qcom-6.6.28-QLI.1.1-Ver.1.1.xml
        # with
        repo init -u https://github.com/quic-yocto/qcom-manifest -b qcom-linux-kirkstone -m qcom-6.6.28-QLI.1.1-Ver.1.1.xmlCopy to clipboard

### 编译

- ***ERROR: linux-kernel-qcom-6.6-r0 do\_menuconfig：No valid terminal found, unable to open devshell***
    此错误可能是在运行 `bitbake linux-kernel-qcom -c menuconfig` 命令时触发的。

**错误摘录**

        ERROR: linux-kernel-qcom-6.6-r0 do_menuconfig：No valid terminal found, unable to open devshell.
        Tried the following commands: 
                tmux split-window -c "{cwd}" "do_terminal"
                tmux new-window -c "{cwd}" -n "linux-kernel-qcom Configuration" "do_terminal"
                xfce4-terminal -T "linux-kernel-qcom Configuration" -e "do_terminal"
                terminology -T="linux-kernel-qcom Configuration" -e do_terminalCopy to clipboard

**解决方案**

        sudo apt install screen
        sudo apt install tmuxCopy to clipboard
- ***NOTE: No reply from server in 30s***
    编译期间，如果您在重新运行 `qsc-cli compile` 或 `bitbake` 命令时看到此错误，可以尝试从部分编译的工作区中删除 `bitbake.lock`、`bitbake.sock` 和 `hashserve.lock` 并重试编译。例如，如果您正在使用 `qsc-cli` 进行编译，则这些文件位于 `<absoute_workspace_path>/DEV/LE.QCLINUX.1.0.r1/build-qcom-wayland` 下。
- ***do\_fetch：BitBake Fetcher Error: FetchError(‘Unable to fetch URL from any source’)***
这是间歇性的获取失败。检查用户端是否存在网络/主机问题，否则可能是服务器造成了此问题。如果在获取 git 代码仓库时发生错误，则可以在您的 `.gitconfig` 文件中增加 `postBuffer` 和 `maxRequestBuffer` 的设置。如果您正在使用 `qsc-cli`，则这些配置已经由 `qsc-cli` 工具处理：

        git config --global http.postBuffer 1048576000
        git config --global http.maxRequestBuffer 1048576000Copy to clipboard

    如果这些配置不起作用，则可以重试编译以第一次绕过这些间歇性错误。

一些大型 git 项目可能会显示此错误。对于此类项目，一种可行选项是按如下方式手动克隆：

        cd <workspace_path>/downloads/git2/
        git clone --bare --mirror https://<url>/<project-name>.git <workspace_path>/downloads/git2/<local-name>.git
        touch <workspace_path>/downloads/git2/<local-name>.git.doneCopy to clipboard

例如，当针对 `qualcomm_linux-spf-1-0-le-qclinux-1-0-r1_api-linux_history_prebuilts.git` 的 `do_fetch` 失败时，运行以下命令：

        git clone --bare --mirror https://qpm-git.qualcomm.com/home2/git/revision-history/qualcomm_linux-spf-1-0-le-qclinux-1-0-r1_api-linux_history_prebuilts.git <workspace_path>/downloads/git2/qpm-git.qualcomm.com.home2.git.revision-history.qualcomm_linux-spf-1-0-le-qclinux-1-0-r1_api-linux_history_prebuilts.git
        touch <workspace_path>/downloads/git2/qpm-git.qualcomm.com.home2.git.revision-history.qualcomm_linux-spf-1-0-le-qclinux-1-0-r1_api-linux_history_prebuilts.git.doneCopy to clipboard

    在创建 `.done` 文件后，继续执行 `bitbake <image-recipe>` 命令。第一次编译完成后，建议设置您自己的[下载目录](https://docs.yoctoproject.org/4.0.16/singleindex.html#term-DL_DIR)。
- ***make[4]：/bin/sh: Argument list too long***
    当工作区的路径长度超过 90 个字符时，就会发生这种情况。减少工作区路径长度以避免此失败。
- ***kernel-source/arch/arm64/boot/dts/qcom/qcm6490-idp.dts:8:10： fatal error: dt-bindings/iio/qcom,spmi-adc7-pmk8350.h：No such file or directory***
    相关文件 `qcom,spmi-adc7-pmk8350.h` 是内核源代码 `<kernel-src>/include/dt-bindings/iio/qcom,spmi-adc7-pmk8350.h` 的一部分。

    检查工作区中的此文件并确保环境已正确初始化以选择此文件。在编译 dtbs 时，内核编译系统运行 GCC 预处理器，以使用其定义替换 dts 文件中的宏。所述路径正是多个 `includes` 文件所在的位置之一。

检查您是否在 git 配置中将 `core.symlinks` 设置为 `false`。如果是，需将其设置为 true：

        git config --global core.symlinks trueCopy to clipboard
- ***qpm-git.qualcomm.com.home2.git.revision-history.qualcomm\_linux-spf-1-0-le-qclinux-1-0-r1\_api-linux\_history\_prebuilts.git --progress failed with exit code 128, no output***
    128 是一个需要进一步分类的屏蔽错误，因为它可能是用户端的网络问题，或者是访问 Qualcomm 或上游镜像时出现的实际问题。有关此错误的解决方法，参见 [do_fetch：BitBake Fetcher Error: FetchError('Unable to fetch URL from any source')](https://docs.qualcomm.com/doc/80-70014-254Y/topic/troubleshoot_sync_build_and_flash.html#troubleshoot_sync_build_and_flash__do_fetch_error).您可以按照后续说明在获取期间转储详细日志，以对其进行进一步分类。

默认情况下，Yocto git 获取未启用详细日志。要为所有 git 项目启用相同功能，可编辑 `local.conf` 文件并将 `BB_GIT_VERBOSE_FETCH` 的值更改为 **1**。此外，还可以为每个配方启用详细日志。例如，要启用详细日志并在 diag 配方中调试 `do_fetch()`失败，可执行以下步骤：
    1. 编辑 `layers/meta-qcom-hwe/recipes-bsp/diag/daig_15.0.bb` 并添加行 `BB_GIT_VERBOSE_FETCH = "1"`。
    2. 使用 `bitbake -fc cleanall diag` 清理之前下载的文件。
    3. 使用 `bitbake -fc fetch diag` 再次获取源代码。
    4. 在 diag 配方的工作目录 `build-qcom-wayland/tmp-glibc/work/qcm6490-qcom-linux/diag/15.0-r0/temp` 下获取具有详细日志的日志。
    5. 与 Qualcomm CE 联系人共享此路径中的 `log.do_fetch`。

Note: 为所有配方启用 git 详细日志会显著增加编译时间。建议仅在需要时在所需配方中启用它。
- ***Failed SP Download with error: &lt;&gt; Sp Download failed.ExitCode: 128 Signal: 0 with errorcode 4***
**错误摘录**

        warning: redirecting to https://git-na-ssl.chipcode.qti.qualcomm.com/57f0ec058e47f7a82b2de7b95111c74a/qualcomm/qualcomm-linux-spf-1-0_ap_standard_oem_nomodem.git/
        remote: Counting objects: 129803, done.
        remote: Compressing objects: 100% (114948/114948), done.
        fatal: write error: No space left on device5 GiB | 1.63 MiB/s
        fatal: fetch-pack: invalid index-pack output
        2024-03-02T14:32:18: Sync Command Failed
        [Error]: Failed SP Download with error: 2024-03-02T14:32:18: Sp Download failed.ExitCode: 128 Signal: 0 with errorcode 4
        [Error]: 2024-03-02T14:32:18: Sp Download failed.ExitCode: 128 Signal: 0Copy to clipboard

    **解决方案**

    错误日志表示设备上没有空间。**"fatal: write error: No space left on device"**.

    清理空间并重新触发。
- ***File "/usr/lib/python3.10/locale.py", line 620, in setlocale return \_setlocale(category, locale)locale.Error: unsupported locale setting***
要解决此错误，可运行以下命令并重新编译：

        sudo locale-gen en_US.UTF-8
        sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
        export LC_ALL=en_US.UTF-8
        export LANG=en_US.UTF-8Copy to clipboard
- ***layer directories do not exist build-qcom-wayland/conf/../../layers/meta-qcom-qim-product-sdk***
此错误是以下原因之一导致的：
    - `Meta-qcom-qim-product-sdk` 的 git 克隆未成功完成。
    - `Meta-qcom-qim-product-sdk` 层未导出到 EXTRALAYERS。

**错误摘录**

        xxxx@xxxx:~/github_un/build-qcom-wayland$ bitbake qcom-multimedia-image
        ERROR: The following layer directories do not exist: 
        ERROR: <workspace_path>/build-qcom-wayland/conf/../../layers/meta-qcom-qim-product-sdk
        ERROR: Please check BBLAYERS in <workspace_path>/build-qcom-wayland/conf/bblayers.confCopy to clipboard

**解决方案**
    - 删除 `build-qcom-wayland` 目录。
    - 重新运行[编译 QIMP SDK 镜像](https://docs.qualcomm.com/doc/80-70014-254Y/topic/github_workflow_unregistered_users.html#build_with_standalone_commands_unreg__section_lrb_1nd_fbc)中的命令。
- ***failed: database disk image is malformed. abort()ing pseudo client by server request***
    伪工具在处理文件系统操作时遇到路径不匹配和数据库损坏的问题。当伪工具在 Yocto 项目中模拟文件系统操作时，处理文件路径和权限的过程中可能会出现问题。

    这是 [Yocto community](https://wiki.yoctoproject.org/wiki/Pseudo_Abort) 中的一个已知问题。

    **解决方案**

运行以下命令：

        rm -rf <workspace_path>/build-qcom-robotics-ros2-humble/tmp-glibc
        bitbake -c cleanall pseudo-native & bitbake pseudo-native
        ../qirp-build qcom-robotics-full-imageCopy to clipboard

### 刷写

无已知错误。

Last Published: Oct 09, 2024

[Previous Topic
注册用户刷写镜像](https://docs.qualcomm.com/bundle/publicresource/80-70014-254Y/topics/flash_images.md) [Next Topic
方法](https://docs.qualcomm.com/bundle/publicresource/80-70014-254Y/topics/how_to.md)