第一次使用 CodeBuild 报错

Errors on using CodeBuild for first time

当开始将代码构建作为简单代码管道的一部分时,我在几秒钟内收到以下错误。

Action execution failed
Error calling startBuild: Cannot have more than 0 builds in queue for the account (Service: AWSCodeBuild; Status Code: 400; Error Code: AccountLimitExceededException; Request ID: 80bfxxxxx

我已经使用 AWS Code 管道向导创建了一个简单的构建和部署过程,所以我假设是配置错误造成的。

我的问题是它指的队列是什么?我 运行 此构建独立于任何其他 AWS 任务?

有关信息,这是我的 buildspec.yml,但我怀疑构建在访问它之前失败了:

version: 0.2

env:

phases:
  install:
    commands:
      - echo Entered the install phase...
      - apt-get update -y
      - apt-get install -y maven
    finally:
      - echo This always runs even if the update or install command fails 
  pre_build:
    commands:
      - echo Entered the pre_build phase...
      - cd server/harvest
    finally:
      - echo This always runs even if the login command fails 
  build:
    commands:
      - echo Entered the build phase...
      - echo Build started on `date`
      - mvn package
    finally:
      - echo This always runs even if the install command fails
  post_build:
    commands:
      - echo Entered the post_build phase...
      - echo Build completed on `date`
artifacts:
  files:
    - target/harvest-1.0-SNAPSHOT.jar
  discard-paths: yes

听起来像是帐户问题。此错误通常意味着您正在使用的帐户未激活(至少不是用于 CodeBuild 订阅),因此不允许在 CodeBuild 中启动任何构建。请联系 AWS 支持以激活您的账户。

由于某种原因,您的帐户限制目前似乎设置为 0。为了增加此限制并能够使用代码构建,您需要联系 AWS 支持。

检查区域。您的帐户在当前地区没有设置代码构建。

我在网络上看到很多建议致电支持人员的答案,这是个好主意,但我实际上能够自己解决这个问题。

作为 root 用户,我进入并放置了当前的信用卡。目前在那里的那个已经过期了。然后我删除了我的 CodeBuild 项目并重建了它。现在我的构建工作了!我很确定 AWS 只需要一个有效的付款方式就可以让我使用高级服务。

我的解决方案可能不适合你,但我当然希望它有用!