Error: Environment *** not found

在使用GitHub Action进行CI时遇到'Environment *** not found'错误,原因是腾讯托管服务器使用了广州区而非默认的上海环境。解决方案包括创建默认的上海节点或指定使用广州节点。官方推荐使用v2版本。提供了一个配置示例,并分享了个人在Java和架构领域的专注点,同时邀请关注获取面试精选题。

错误图片

使用github action 实现自动ci,如果报错Error: Environment *** not found,我这边出现这个问题的原因是,腾讯托管服务器用的广州区,不是默认的上海环境,所以有这个问题,就是我们制定的那个环境ID,是广州的,不是默认的上海节点。
解决的办法有两个,第一个办法是创建一个默认节点(上海节点),继续使用TencentCloudBase/cloudbase-action@v1.1.1;但是官方推荐开发者使用 v2 版本。
通过cloudbaserc.json文件的"region": "gz"指定广州节点。
下边是一个案例,可以参考一下。

{
   
   
    "envId": "{
   
   {envId}}",
    "version": "2.0",
    "region"
[11:00:47.201] DDR Version 2.12 20190926 [11:00:47.201] In [11:00:47.206] ID:0xFFF [11:00:47.206] 1A1A1A1B 3 [11:00:47.206] DDR3 [11:00:47.206] 1A1B1A1B F [11:00:47.212] Bus Width=32 Col=10 Bank=8 Row=14 CS=1 Die Bus-Width=16 Size=512MB [11:00:47.218] mach:1 [11:00:47.218] OUT [11:00:47.393] Boot1 Release Time: Sep 25 2020 14:49:05, version: 2.63 [11:00:47.398] ChipType = 0xa, 2278 [11:00:47.432] mmc2:cmd19,100 [11:00:47.432] SdmmcInit=2 0 [11:00:47.432] BootCapSize=1000 [11:00:47.438] UserCapSize=3776\CD&\A7\AC\8B\C5,20 [11:00:47.519] SdmmcInit=0 1 [11:00:47.519] StorageInit ok = 125713 [11:00:47.526] SecureMode = 0 [11:00:47.526] Secure read: 4 128636 [11:00:47.526] mmc2:cmd18,10 [11:00:47.526] mmc2:cmd12,20 [11:00:47.526] _DataErrorHandle SEND STATUS ret=20 [11:00:47.533] Secure read: 404 136468 [11:00:47.533] Secure read: 804 138895 [11:00:47.541] Secure read: c04 140971 [11:00:47.541] Secure read: 1004 143139 [11:00:47.541] Secure read: 1404 145392 [11:00:47.541] Secure read: 1804 147683 [11:00:47.549] Secure read: 1c04 149938 [11:00:47.549] SecureInit ret = 0, SecureMode = 0 [11:00:47.556] GPT part: 0, name: uboot, start:0x2000, size:0x1000 [11:00:47.564] GPT part: 1, name: trust, start:0x3000, size:0x1000 [11:00:47.564] GPT part: 2, name: misc, start:0x4000, size:0x800 [11:00:47.571] GPT part: 3, name: boot, start:0x4800, size:0x6800 [11:00:47.580] GPT part: 4, name: recovery, start:0xb000, size:0xa000 [11:00:47.580] GPT part: 5, name: rootfs, start:0x15000, size:0x60000 [11:00:47.590] GPT part: 6, name: oem, start:0x75000, size:0x90000 [11:00:47.600] GPT part: 7, name: userdata, start:0x105000, size:0x65afdf [11:00:47.600] find part:uboot OK. first_lba:0x2000. [11:00:47.600] find part:trust OK. first_lba:0x3000. [11:00:47.632] LOADER Check OK! 0x2000, 238620 [11:00:47.654] TOS Check OK! 0x3000, 260506 [11:00:47.662] Enter Trust OS [11:00:47.671] INF [0x0] TEE-CORE:init_primary_helper:385: Core0 Initializing (1.1.0-449-g24f5da14f #hisping.lin #1 Mon Aug 14 06:20:42 UTC 2023 arm) [11:00:47.689] [11:00:47.689] INF [0x0] TEE-CORE:init_primary_helper:386: Release version: 1.2 [11:00:47.689] [11:00:47.689] INF [0x0] TEE-CORE:init_primary_helper:387: Next entry point address: 0x60000000 [11:00:47.700] [11:00:47.700] INF [0x0] TEE-CORE:init_teecore:83: teecore inits done [11:00:47.723] [11:00:47.768] [11:00:47.768] U-Boot 2017.09-230909-dirty #joss (Feb 07 2025 - 14:52:30 +0800) [11:00:47.778] [11:00:47.778] Model: Rockchip RK3126 Evaluation board [11:00:47.778] MPIDR: 0x80000f00 [11:00:47.789] Serial: rawDRAM: 497.9 MiB [11:00:47.799] Sysmem: init [11:00:47.799] Relocation Offset: 1dc24000 [11:00:47.799] Relocation fdt: 7bc19eb0 - 7bc1aded [11:00:47.875] CR: M/C/I [11:00:47.884] DM: v1 [11:00:47.884] rk3036_pll_set_rate: wait pll lock timeout! pll_id=0 [11:00:47.895] rk3036_pll_set_rate: wait pll lock timeout! pll_id=2 [11:00:47.895] dwmmc@1021c000: 0 [11:00:47.895] MMC Device 1 not found [11:00:47.895] no mmc device at slot 1 [11:00:47.938] switch to partitions #0, OK [11:00:47.938] mmc0(part 0) is current device [11:00:47.947] Bootdev(scan): mmc 0 [11:00:47.947] MMC0: High Speed, 52Mhz [11:00:47.947] PartType: EFI [11:00:47.984] MMC error: The cmd index is 17, ret is -110 [11:00:48.044] MMC error: The cmd index is 0, ret is -110 [11:00:48.051] mmc_init: -110, time 61 [11:00:48.051] *** ERROR: Can't read MBR header *** [11:00:48.061] part_get_info_efi: *** ERROR: Invalid GPT *** [11:00:48.105] MMC error: The cmd index is 16, ret is -110 [11:00:48.111] *** ERROR: Can't read MBR header *** [11:00:48.111] part_get_info_efi: *** ERROR: Invalid Backup GPT *** [11:00:48.164] MMC error: The cmd index is 16, ret is -110 [11:00:48.170] *** ERROR: Can't read MBR header *** [11:00:48.170] part_get_info_efi: *** ERROR: Invalid GPT *** [11:00:48.223] MMC error: The cmd index is 16, ret is -110 [11:00:48.230] *** ERROR: Can't read MBR header *** [11:00:48.230] part_get_info_efi: *** ERROR: Invalid Backup GPT *** [11:00:48.282] MMC error: The cmd index is 16, ret is -110 [11:00:48.289] *** ERROR: Can't read MBR header *** [11:00:48.289] part_get_info_efi: *** ERROR: Invalid GPT *** [11:00:48.341] MMC error: The cmd index is 16, ret is -110 [11:00:48.348] *** ERROR: Can't read MBR header *** [11:00:48.348] part_get_info_efi: *** ERROR: Invalid Backup GPT *** [11:00:48.400] MMC error: The cmd index is 16, ret is -110 [11:00:48.409] *** ERROR: Can't read MBR header *** [11:00:48.409] part_get_info_efi: *** ERROR: Invalid GPT *** [11:00:48.459] MMC error: The cmd index is 16, ret is -110 [11:00:48.466] *** ERROR: Can't read MBR header *** [11:00:48.466] part_get_info_efi: *** ERROR: Invalid Backup GPT *** [11:00:48.478] No misc partition [11:00:48.478] boot mode: None [11:00:48.521] MMC error: The cmd index is 16, ret is -110 [11:00:48.529] *** ERROR: Can't read MBR header *** [11:00:48.529] part_get_info_efi: *** ERROR: Invalid GPT *** [11:00:48.580] MMC error: The cmd index is 16, ret is -110 [11:00:48.586] *** ERROR: Can't read MBR header *** [11:00:48.586] part_get_info_efi: *** ERROR: Invalid Backup GPT *** [11:00:48.639] MMC error: The cmd index is 16, ret is -110 [11:00:48.647] *** ERROR: Can't read MBR header *** [11:00:48.647] part_get_info_efi: *** ERROR: Invalid GPT *** [11:00:48.698] MMC error: The cmd index is 16, ret is -110 [11:00:48.704] *** ERROR: Can't read MBR header *** [11:00:48.704] part_get_info_efi: *** ERROR: Invalid Backup GPT *** [11:00:48.757] MMC error: The cmd index is 16, ret is -110 [11:00:48.763] *** ERROR: Can't read MBR header *** [11:00:48.763] part_get_info_efi: *** ERROR: Invalid GPT *** [11:00:48.816] MMC error: The cmd index is 16, ret is -110 [11:00:48.823] *** ERROR: Can't read MBR header *** [11:00:48.823] part_get_info_efi: *** ERROR: Invalid Backup GPT *** [11:00:48.876] MMC error: The cmd index is 16, ret is -110 [11:00:48.883] *** ERROR: Can't read MBR header *** [11:00:48.883] part_get_info_efi: *** ERROR: Invalid GPT *** [11:00:48.935] MMC error: The cmd index is 16, ret is -110 [11:00:48.942] *** ERROR: Can't read MBR header *** [11:00:48.942] part_get_info_efi: *** ERROR: Invalid Backup GPT *** [11:00:48.954] Failed to load DTB, ret=-19 [11:00:48.954] No valid DTB, ret=-22 [11:00:48.954] Failed to get kernel dtb, ret=-22 [11:00:49.002] MMC error: The cmd index is 16, ret is -110 [11:00:49.009] *** Warning - read failed, using default environment [11:00:49.009] [11:00:49.019] Model: Rockchip RK3126 Evaluation board [11:00:49.019] MPIDR: 0x80000f00 [11:00:49.069] MMC error: The cmd index is 16, ret is -110 [11:00:49.120] MMC error: The cmd index is 16, ret is -110 [11:00:49.127] rockchip_set_ethaddr: vendor_storage_write failed -5 [11:00:49.176] MMC error: The cmd index is 16, ret is -110 [11:00:49.227] MMC error: The cmd index is 16, ret is -110 [11:00:49.235] *** ERROR: Can't read MBR header *** [11:00:49.235] part_get_info_efi: *** ERROR: Invalid GPT *** [11:00:49.285] MMC error: The cmd index is 16, ret is -110 [11:00:49.293] *** ERROR: Can't read MBR header *** [11:00:49.293] part_get_info_efi: *** ERROR: Invalid Backup GPT *** [11:00:49.345] MMC error: The cmd index is 16, ret is -110 [11:00:49.352] *** ERROR: Can't read MBR header *** [11:00:49.352] part_get_info_efi: *** ERROR: Invalid GPT *** [11:00:49.404] MMC error: The cmd index is 16, ret is -110 [11:00:49.411] *** ERROR: Can't read MBR header *** [11:00:49.411] part_get_info_efi: *** ERROR: Invalid Backup GPT *** [11:00:49.463] MMC error: The cmd index is 16, ret is -110 [11:00:49.471] *** ERROR: Can't read MBR header *** [11:00:49.471] part_get_info_efi: *** ERROR: Invalid GPT *** [11:00:49.522] MMC error: The cmd index is 16, ret is -110 [11:00:49.529] *** ERROR: Can't read MBR header *** [11:00:49.529] part_get_info_efi: *** ERROR: Invalid Backup GPT *** [11:00:49.581] MMC error: The cmd index is 16, ret is -110 [11:00:49.588] *** ERROR: Can't read MBR header *** [11:00:49.588] part_get_info_efi: *** ERROR: Invalid GPT *** [11:00:49.640] MMC error: The cmd index is 16, ret is -110 [11:00:49.647] *** ERROR: Can't read MBR header *** [11:00:49.647] part_get_info_efi: *** ERROR: Invalid Backup GPT *** [11:00:49.658] CLK: (uboot. arm: enter 300000 KHz, init 600000 KHz, kernel 0N/A) [11:00:49.658] apll 600000 KHz [11:00:49.658] dpll 600000 KHz [11:00:49.668] cpll 400000 KHz [11:00:49.668] gpll 594000 KHz [11:00:49.668] armclk 600000 KHz [11:00:49.668] aclk_cpu 148500 KHz [11:00:49.668] hclk_cpu 74250 KHz [11:00:49.668] pclk_cpu 74250 KHz [11:00:49.679] aclk_peri 148500 KHz [11:00:49.679] hclk_peri 74250 KHz [11:00:49.679] pclk_peri 74250 KHz [11:00:49.724] MMC error: The cmd index is 16, ret is -110 [11:00:49.731] *** ERROR: Can't read MBR header *** [11:00:49.731] part_get_info_efi: *** ERROR: Invalid GPT *** [11:00:49.783] MMC error: The cmd index is 16, ret is -110 [11:00:49.792] *** ERROR: Can't read MBR header *** [11:00:49.792] part_get_info_efi: *** ERROR: Invalid Backup GPT *** [11:00:49.842] MMC error: The cmd index is 16, ret is -110 [11:00:49.848] *** ERROR: Can't read MBR header *** [11:00:49.848] part_get_info_efi: *** ERROR: Invalid GPT *** [11:00:49.901] MMC error: The cmd index is 16, ret is -110 [11:00:49.908] *** ERROR: Can't read MBR header *** [11:00:49.908] part_get_info_efi: *** ERROR: Invalid Backup GPT *** [11:00:49.918] Net: Net Initialization Skipped [11:00:49.918] No ethernet found. [11:00:49.918] Hit key to stop autoboot('CTRL+C'): 0 [11:00:49.969] MMC error: The cmd index is 16, ret is -110 [11:00:49.976] *** ERROR: Can't read MBR header *** [11:00:49.976] part_get_info_efi: *** ERROR: Invalid GPT *** [11:00:50.028] MMC error: The cmd index is 16, ret is -110 [11:00:50.035] *** ERROR: Can't read MBR header *** [11:00:50.035] part_get_info_efi: *** ERROR: Invalid Backup GPT *** [11:00:50.087] MMC error: The cmd index is 16, ret is -110 [11:00:50.094] *** ERROR: Can't read MBR header *** [11:00:50.094] part_get_info_efi: *** ERROR: Invalid GPT *** [11:00:50.146] MMC error: The cmd index is 16, ret is -110 [11:00:50.152] *** ERROR: Can't read MBR header *** [11:00:50.152] part_get_info_efi: *** ERROR: Invalid Backup GPT *** [11:00:50.162] Could not find misc partition [11:00:50.162] ANDROID: reboot reason: "(none)" [11:00:50.162] optee api revision: 2.0 [11:00:50.214] MMC error: The cmd index is 16, ret is -110 [11:00:50.222] *** ERROR: Can't read MBR header *** [11:00:50.222] part_get_info_efi: *** ERROR: Invalid GPT *** [11:00:50.273] MMC error: The cmd index is 16, ret is -110 [11:00:50.280] *** ERROR: Can't read MBR header *** [11:00:50.280] part_get_info_efi: *** ERROR: Invalid Backup GPT *** [11:00:50.332] MMC error: The cmd index is 16, ret is -110 [11:00:50.339] *** ERROR: Can't read MBR header *** [11:00:50.339] part_get_info_efi: *** ERROR: Invalid GPT *** [11:00:50.391] MMC error: The cmd index is 16, ret is -110 [11:00:50.398] *** ERROR: Can't read MBR header *** [11:00:50.398] part_get_info_efi: *** ERROR: Invalid Backup GPT *** [11:00:50.410] TEEC: Waring: Could not find security partition [11:00:50.456] MMC error: The cmd index is 16, ret is -110 [11:00:50.464] *** ERROR: Can't read MBR header *** [11:00:50.464] part_get_info_efi: *** ERROR: Invalid GPT *** [11:00:50.514] MMC error: The cmd index is 16, ret is -110 [11:00:50.522] *** ERROR: Can't read MBR header *** [11:00:50.522] part_get_info_efi: *** ERROR: Invalid Backup GPT *** [11:00:50.574] MMC error: The cmd index is 16, ret is -110 [11:00:50.581] *** ERROR: Can't read MBR header *** [11:00:50.581] part_get_info_efi: *** ERROR: Invalid GPT *** [11:00:50.633] MMC error: The cmd index is 16, ret is -110 [11:00:50.641] *** ERROR: Can't read MBR header *** [11:00:50.641] part_get_info_efi: *** ERROR: Invalid Backup GPT *** [11:00:50.652] Not AVB images, AVB skip [11:00:50.695] MMC error: The cmd index is 16, ret is -110 [11:00:50.702] *** ERROR: Can't read MBR header *** [11:00:50.702] part_get_info_efi: *** ERROR: Invalid GPT *** [11:00:50.754] MMC error: The cmd index is 16, ret is -110 [11:00:50.761] *** ERROR: Can't read MBR header *** [11:00:50.761] part_get_info_efi: *** ERROR: Invalid Backup GPT *** [11:00:50.813] MMC error: The cmd index is 16, ret is -110 [11:00:50.820] *** ERROR: Can't read MBR header *** [11:00:50.820] part_get_info_efi: *** ERROR: Invalid GPT *** [11:00:50.872] MMC error: The cmd index is 16, ret is -110 [11:00:50.880] *** ERROR: Can't read MBR header *** [11:00:50.880] part_get_info_efi: *** ERROR: Invalid Backup GPT *** [11:00:50.891] android_image_load_by_partname: Can't find part: boot [11:00:50.891] Android image load failed [11:00:50.891] Android boot failed, error -1. [11:00:50.891] Unknown command 'boot_fit' - try 'help' [11:00:50.945] MMC error: The cmd index is 16, ret is -110 [11:00:50.952] *** ERROR: Can't read MBR header *** [11:00:50.952] part_get_info_efi: *** ERROR: Invalid GPT ***
08-14
在设备启动日志中,如果U-Boot启动阶段出现MMC错误和GPT分区无效的问题,通常意味着U-Boot无法正确访问存储介质(如eMMC或SD卡)或无法识别其上的分区结构。以下是对这些问题的分析及可能的解决方案。 ### MMC错误分析与解决 MMC错误通常表现为U-Boot无法初始化MMC控制器或读取MMC设备信息。常见错误信息包括“MMC: no card present”、“MMC read: unable to read block”等。 #### 可能原因与解决方案: - **硬件连接问题**:检查MMC插槽与控制器之间的物理连接,是否存在接触不良或短路情况。确保电源稳定,避免因电压不稳导致设备无法识别[^1]。 - **驱动支持问题**:确认U-Boot版本是否支持当前使用的MMC控制器和存储设备。例如,在Rockchip平台,可能需要更新U-Boot以支持最新的eMMC 5.1规范或特定的SD卡型号[^3]。 - **初始化参数问题**:调整U-Boot中的MMC初始化参数,例如时钟频率、总线宽度等,确保与设备规格匹配。可以通过修改`include/configs/`目录下的配置文件实现。 ### GPT分区无效问题分析与解决 GPT(GUID Partition Table)是现代设备常用的分区表格式,相较于传统的MBR,GPT支持更大的磁盘容量和更多的分区数量。若U-Boot报告GPT分区无效,可能是分区表损坏、不兼容或配置错误所致。 #### 可能原因与解决方案: - **分区表损坏**:使用`gdisk`或`parted`工具检查并修复磁盘上的GPT分区表。确保备份的GPT头和分区项未被破坏。如果发现损坏,可尝试从备份恢复[^2]。 - **U-Boot对GPT的支持**:确认当前U-Boot版本是否启用了对GPT的支持。在配置文件中查找`CONFIG_EFI_PARTITION`宏定义,确保其被启用。若未启用,需重新编译U-Boot并加入该选项[^1]。 - **分区配置错误**:检查启动参数中的`partitions`字段是否正确指定了文件系统类型(如`ext4`),并确认内核是否能够识别GPT分区。例如,在启动参数中添加`partitions=ext4`有助于内核正确解析GPT分区[^3]。 ### 示例:检查并修复GPT分区表 ```bash # 使用 gdisk 检查磁盘 sudo gdisk -l /dev/mmcblk0 # 若发现错误,可尝试重建GPT头 sudo gdisk /dev/mmcblk0 # 在交互界面中输入 'w' 保存更改并退出 ``` ### 示例:U-Boot配置启用GPT支持 ```c // 在配置文件中启用GPT支持 #define CONFIG_EFI_PARTITION ``` ### 示例:修改U-Boot启动参数以支持GPT分区 ```bash // 在U-Boot命令行中设置启动参数 setenv bootargs 'earlyprintk=sunxi-uart,0x02500000 clk_ignore_unused console=ttyS0,115200 loglevel=8 root=/dev/mmcblk0p4 rw init=/sbin/init partitions=ext4 gpt=1' ``` ### 总结 解决U-Boot启动日志中的MMC错误和GPT分区无效问题,需要从硬件连接、驱动支持、初始化参数、分区表完整性以及U-Boot配置等多个方面进行排查。通过上述方法,可以逐步定位问题并采取相应措施加以解决。 ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值