首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >错误..。生成期间未处理的异常。运行管道时

错误..。生成期间未处理的异常。运行管道时
EN

Stack Overflow用户
提问于 2022-11-24 12:21:41
回答 1查看 39关注 0票数 3

试图运行一条管道,我的设置:

带有自动标度和负载均衡器的

  • GitHub
  • Elastic豆秆
  • S3桶用于持久静态文件

在运行管道之后,它无法部署所有具有相同版本的实例。因此,从我的日志中,我发现它在运行container_commands时失败了。

代码语言:javascript
复制
option_settings:
  "aws:elasticbeanstalk:application:environment":
    DJANGO_SETTINGS_MODULE: project.settings
    "PYTHONPATH": "/opt/python/current/:$PYTHONPATH"
  "aws:elasticbeanstalk:container:python":
    WSGIPath: project.wsgi:application
    NumProcesses: 3
    NumThreads: 20
  "aws:elasticbeanstalk:environment:proxy:staticfiles":
    /html: statichtml
    /static-files: static-files
    /media: media-files




**container_commands:
   10_deploy_hook_permissions:
     command: |
       sudo find .platform/ -type f -iname "*.sh" -exec chmod -R 755 {} \;
       sudo find /var/app/staging/.platform/ -type f -iname "*.sh" -exec chmod -R 755 {} \;**

它执行如下:

代码语言:javascript
复制
#!/bin/sh

source /var/app/venv/staging-LQM1lest/bin/activate
python /var/app/current/manage.py collectstatic --noinput
python /var/app/current/manage.py migrate

注意:当我运行"eb deploy“时,应用程序部署非常好,但是当从管道触发部署时,它会进入”降级“状态,其中实例仍在运行,但显然并不是所有实例都运行相同版本。

健康方面的错误:

代码语言:javascript
复制
over all :  - Command failed on all instances.
            - Incorrect application version found on all instances. Expected version 
              "app-221124_115515680871" (deployment 418).

instance :  - Application deployment failed at 2022-11-24T11:32:55Z with exit status 1 
               and error: Engine execution has encountered an error.
            - Incorrect application version "code-pipeline-575- 
              3e3311a14d472807da9bcf9f73d5778e38c9c651" (deployment 420). Expected 
               version "app-221124_1680871" (deployment 418).



from commands-logs

2022-11-24 15:36:24,190 P17748 [INFO] Command 10_deploy_hook_permissions
2022-11-24 15:36:24,239 P17748 [INFO] -----------------------Command Output-----------------------
2022-11-24 15:36:24,239 P17748 [INFO]   find: ‘.platform/’: No such file or directory
2022-11-24 15:36:24,239 P17748 [INFO]   find: ‘/var/app/staging/.platform/’: No such file or directory
2022-11-24 15:36:24,239 P17748 [INFO] ------------------------------------------------------------
2022-11-24 15:36:24,239 P17748 [ERROR] Exited with error code 1

也尝试使用不同的配置:

代码语言:javascript
复制
container_commands:
  01_makemigrations:
    command: "source /var/app/venv/*/bin/activate && python3 manage.py makemigrations --noinput"
  02_migrate:
    command: "source /var/app/venv/*/bin/activate && python3 manage.py migrate --noinput"
  03_collectstatic:
    command: "source /var/app/venv/*/bin/activate && python3 manage.py collectstatic --noinput"


But this time I get this wrror :

2022-11-25 08:56:46,187 P2294 [INFO] Command 01_makemigrations
2022-11-25 08:56:46,222 P2294 [INFO] -----------------------Command Output-----------------------
2022-11-25 08:56:46,222 P2294 [INFO]    python3: can't open file 'manage.py': [Errno 2] No such file or directory
2022-11-25 08:56:46,222 P2294 [INFO] ------------------------------------------------------------
2022-11-25 08:56:46,222 P2294 [ERROR] Exited with error code 2

我还在我的弹性豆柄环境中设置了全局变量。属性

不知道该怎么办了。很明显,它无法找到文件或运行命令。

EN

回答 1

Stack Overflow用户

发布于 2022-11-30 09:13:00

因此,当我输入后端文件夹时,这些命令就会运行。

代码语言:javascript
复制
container_commands:
   10_deploy_hook_permissions:
     command: |
       sudo find .platform/ -type f -iname "*.sh" -exec chmod -R 755 {} \;
       sudo find /var/app/staging/backend/.platform/ -type f -iname "*.sh" -exec chmod -R 755 {} \;

然而,一切看起来都很好,管道和命令明智,但服务器没有运行,我没有收到任何错误消息。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/74560714

复制
相关文章

相似问题

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