首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >弹力豆柄未能解压缩具有UTF-8文件名的源文件

弹力豆柄未能解压缩具有UTF-8文件名的源文件
EN

Stack Overflow用户
提问于 2022-01-31 06:58:57
回答 1查看 164关注 0票数 0

我试图通过NextJS将一个eb deploy应用程序部署到弹性豆柄。但是,源包在部署期间未能解压缩,因为源包包含一些预构建的.next页面,文件名为UTF-8编码。错误说明如下。

代码语言:javascript
运行
复制
2022/xx/xx xx:xx:xx.xxxxxx [INFO] Executing instruction: StageApplication
2022/xx/xx xx:xx:xx.xxxxxx [INFO] extracting /opt/elasticbeanstalk/deployment/app_source_bundle to /var/app/staging/
2022/01/31 04:56:44.300483 [INFO] Running command /bin/sh -c /usr/bin/unzip -q -o /opt/elasticbeanstalk/deployment/app_source_bundle -d /var/app/staging/
2022/01/31 04:56:45.932820 [ERROR] An error occurred during execution of command [app-deploy] - [StageApplication]. Stop running the command. Error: Command /bin/sh -c /usr/bin/unzip -q -o /opt/elasticbeanstalk/deployment/app_source_bundle -d /var/app/staging/ failed with error exit status 50. Stderr:error:  cannot create /var/app/staging/.next/server/pages/\u6e2c\u8a66/\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66.html
        File name too long
error:  cannot create /var/app/staging/.next/server/pages/\u6e2c\u8a66/\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66.json
        File name too long

我能够用选项-O UTF-8解压缩该文件,是否可以将此标志添加到eb deploy解压缩过程中?

编辑1.我正在使用平台64bit Amazon Linux 2/5.4.9

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-09-15 09:32:06

不确定这是否是一个很好的实践,但我最终添加了一个eb扩展名,以克服原来的解压流。

代码语言:javascript
运行
复制
commands:
  command backup original zip: 
    command: |
      logger "backup zip" && cp /opt/elasticbeanstalk/deployment/app_source_bundle /tmp/app_source_bundle_bak &&
      logger "rm existing zip .next folder" && zip -Ad /opt/elasticbeanstalk/deployment/app_source_bundle ".next/*"
    cwd: /home/ec2-user
    ignoreErrors: false

container_commands:
  replace the original zip to staging: 
    command: |
      logger "custom unzip" &&
      unzip -O UTF-8 -q -o /tmp/app_source_bundle_bak -d /var/app/staging/
    cwd: /home/ec2-user
    ignoreErrors: false
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70922212

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档