将laravel应用程序分发到AWS Elastic Bean时出现问题

时间:2019-08-24 14:39:37

标签: amazon-web-services laravel-5 web-deployment amazon-elastic-beanstalk

我正在尝试将laravel应用程序部署到AWS Elastic beanstalk,应该上传包含我的源代码的zip文件,并且在下面出现此错误:

 /opt/elasticbeanstalk/deploy/appsource/source_bundle
    End-of-central-directory signature not found.  Either this file is not
    a zipfile, or it constitutes one disk of a multi-part archive.  In the
    latter case the central directory and zipfile comment will be found on
    the last disk(s) of this archive.

日志

[2019-08-24T13:43:37.154Z] INFO  [3147]  - [Application deployment siitag-laravel-source-1@1/StartupStage0/AppDeployPreHook] : Starting activity...
[2019-08-24T13:43:37.154Z] INFO  [3147]  - [Application deployment siitag-laravel-source-1@1/StartupStage0/AppDeployPreHook/01_unzip.sh] : Starting activity...
[2019-08-24T13:43:37.454Z] INFO  [3147]  - [Application deployment siitag-laravel-source-1@1/StartupStage0/AppDeployPreHook/01_unzip.sh] : Activity execution failed, because: ++ /opt/elasticbeanstalk/bin/get-config container -k app_user
  + EB_APP_USER=webapp
  ++ /opt/elasticbeanstalk/bin/get-config container -k app_staging_dir
  + EB_APP_STAGING_DIR=/var/app/ondeck
  ++ /opt/elasticbeanstalk/bin/get-config container -k source_bundle
  + EB_SOURCE_BUNDLE=/opt/elasticbeanstalk/deploy/appsource/source_bundle
  + rm -rf /var/app/ondeck
  + /usr/bin/unzip -d /var/app/ondeck /opt/elasticbeanstalk/deploy/appsource/source_bundle
  Archive:  /opt/elasticbeanstalk/deploy/appsource/source_bundle
    End-of-central-directory signature not found.  Either this file is not
    a zipfile, or it constitutes one disk of a multi-part archive.  In the
    latter case the central directory and zipfile comment will be found on
    the last disk(s) of this archive.
  unzip:  cannot find zipfile directory in one of /opt/elasticbeanstalk/deploy/appsource/source_bundle or
          /opt/elasticbeanstalk/deploy/appsource/source_bundle.zip, and cannot find /opt/elasticbeanstalk/deploy/appsource/source_bundle.ZIP, period. (ElasticBeanstalk::ExternalInvocationError)
caused by: ++ /opt/elasticbeanstalk/bin/get-config container -k app_user
  + EB_APP_USER=webapp
  ++ /opt/elasticbeanstalk/bin/get-config container -k app_staging_dir
  + EB_APP_STAGING_DIR=/var/app/ondeck
  ++ /opt/elasticbeanstalk/bin/get-config container -k source_bundle
  + EB_SOURCE_BUNDLE=/opt/elasticbeanstalk/deploy/appsource/source_bundle
  + rm -rf /var/app/ondeck
  + /usr/bin/unzip -d /var/app/ondeck /opt/elasticbeanstalk/deploy/appsource/source_bundle
  Archive:  /opt/elasticbeanstalk/deploy/appsource/source_bundle
    End-of-central-directory signature not found.  Either this file is not
    a zipfile, or it constitutes one disk of a multi-part archive.  In the
    latter case the central directory and zipfile comment will be found on
    the last disk(s) of this archive.
  unzip:  cannot find zipfile directory in one of /opt/elasticbeanstalk/deploy/appsource/source_bundle or
          /opt/elasticbeanstalk/deploy/appsource/source_bundle.zip, and cannot find /opt/elasticbeanstalk/deploy/appsource/source_bundle.ZIP, period. (Executor::NonZeroExitStatus)


[2019-08-24T13:43:37.454Z] INFO  [3147]  - [Application deployment siitag-laravel-source-1@1/StartupStage0/AppDeployPreHook/01_unzip.sh] : Activity failed.
[2019-08-24T13:43:37.454Z] INFO  [3147]  - [Application deployment siitag-laravel-source-1@1/StartupStage0/AppDeployPreHook] : Activity failed.

我不知道如何解决这个问题,任何想法或解决方案都值得赞赏

1 个答案:

答案 0 :(得分:0)

解决方案是将源代码压缩为.zip而不是.rar