我开始看到几周前没有发生的错误。我不明白如何解决这个问题。
错误是:
serverless package --stage $STAGE
....
Serverless: Excluding development dependencies...
Uploading artifacts...
server/.serverless: found 27 matching files
WARNING: Uploading artifacts to coordinator... failed id=169012 responseStatus=500 Internal Server Error status=500 Internal Server Error token=nsTzM9su
WARNING: Retrying... error=invalid argument
WARNING: Uploading artifacts to coordinator... failed id=169012 responseStatus=500 Internal Server Error status=500 Internal Server Error token=nsTzM9su
WARNING: Retrying... error=invalid argument
WARNING: Uploading artifacts to coordinator... failed id=169012 responseStatus=500 Internal Server Error status=500 Internal Server Error token=nsTzM9su
FATAL: invalid argument
ERROR: Job failed: exit code 1
这在开发、测试和生产的构建阶段失败。
这是 gitlab-ci.yml 的内容,这里没有任何变化:
image: amaysim/serverless:2.13.0
before_script:
- uname -a
- node --version
- yarn --version
- serverless --version
- aws --version
- echo Stage is $STAGE
# Cache modules in between jobs#
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- .yarn-cache
variables:
AWS_SHARED_CREDENTIALS_FILE: "xxxx"
AWS_CONFIG_FILE: "xxxx"
YARN_CACHE_FOLDER: "xxxx"
.build:server_template: &build_server_job_definition
stage: build
script:
- cd server
- yarn install
- serverless package --stage $STAGE
artifacts:
paths:
- server/.serverless
build:client:
stage: build
script:
- cd client
- yarn install
- yarn run build
.deploy_template: &deploy_job_definition
stage: deploy
script:
- cd vpc # repeated deploys of the VPC won't change existing VPCs
- yarn install
- serverless deploy --stage $STAGE
- cd ../server
- yarn install
- serverless deploy --package .serverless --stage $STAGE
- cd ../client
- yarn install
- yarn run build
- serverless client deploy --stage $STAGE --no-confirm
artifacts:
paths:
- client/.env
- server/.serverless
build:server:dev:
variables:
STAGE: dev
<<: *build_server_job_definition
build:server:test:
variables:
STAGE: test
<<: *build_server_job_definition
build:server:prod:
variables:
STAGE: prod
<<: *build_server_job_definition
deploy:dev:
variables:
STAGE: dev
dependencies:
- build:server:dev
<<: *deploy_job_definition
deploy:test:
variables:
STAGE: test
dependencies:
- build:server:test
<<: *deploy_job_definition
only:
- develop
deploy:prod:
variables:
STAGE: prod
dependencies:
- build:server:prod
<<: *deploy_job_definition
when: manual
only:
- master
test:client:
image: cypress/base:12
stage: test
before_script:
- node --version
- yarn --version
script:
- cd client
- yarn install
- yarn run start-then-test
我尝试注释掉工件部分,但这只会导致另一个错误(缺少 serverless-state.json)。
我不确定在这里尝试什么。任何帮助将不胜感激。