AWS Copilot pipeline fails, why cant CodeBuild find buildspec.yml? - amazon-web-services

I created an aws Copilot pipeline but it fails because CodeBuild says it can't find buildspec.yml.
I'm not sure where the beginning of the path comes from /codebuild/output/src1#####3/src/ however the second part of the path is exactly correct /copilot/pipelines/projectname-master/buildspec.yml
How can I troubleshoot why this file cannot be found?
Note: this was set up using the copilot pipeline init cli command

I believe the problem is related to a bug surfaced here: https://github.com/aws/copilot-cli/issues/3468, which has been fixed with https://github.com/aws/copilot-cli/pull/3532 and released just this morning – please update Copilot to v1.18.0.

Related

Created a pipeline using AWS copilot, original push worked but when I make changes to code and push them to github they don't show up

would appreciate any help with this:
I've followed the guide for AWS copilot here: https://aws.github.io/copilot-cli/docs/getting-started/first-app-tutorial/ and then the guide for creating a pipeline and connecting it to github here: https://aws.github.io/copilot-cli/docs/concepts/pipelines/. That all appears to have worked and I can view the react app I'm working on at the url indicated in aws.
My problem is that when I make changes to my code and then push it to the tracked github branch, the changes don't appear when viewing the app at the url. However, when I make the push to github, the pipeline does register that a change has occured. It indicates that a change has been made and goes through the flow of creating a new build. But whatever I try, the changes don't seem to actually show up.
I assume that I'm missing something simple here, and that for some reason, docker is building the app based on the original code. But I can't figure out why that would be. Maybe something is weird with my DockerFile?
My docker file looks like this:
FROM node:16.14
WORKDIR /app
ENV PATH /app/node_modules/.bin:$PATH
COPY package.json ./
COPY package-lock.json ./
RUN npm i
COPY . ./
CMD ["npm", "run", "server"]
My understanding of how this should work, is that I push up new code to github, that is sent to the aws pipeline and a new image is generated based on that code, which is then used to create a container that is hosted on ECS. But clearly I am missing something.
copilot deploy does work. I'm unsure if
the problem is that my pipeline is successfully building (as it does not throw an error in the console) and then just not hosting it at the same url as copilot deploy. Or
the pipeline is hitting an error that just doesn't show up in the pipeline console. Digging into the logs I find this:
echo "Cloudformation stack and config files were not generated. Please check build logs to see if there was a manifest validation error." 1>&2;
Which seems to point towards the second option. Any suggestions on how resolve whatever it going on in the container if that is the problem?
The error suggests that I check build logs but these are the build logs. Are there more granular build logs I can examine?
When running containers in ECS, unless your container is already crashing because of an error, it often won't pick up code changes from your new image unless you force a new deployment. You can do this from the command line using the AWS CLI with the following:
aws ecs update-service --cluster <cluster_name> --service <service_name> --force-new-deployment --profile <aws_profile_name>
Note that the profile is optional if you're using your default aws cli configuration profile.

Serverless and AWS deploy issue

I have to update a website on aws using serverless deploy.
This website were not created by me, it's the first time I work with serverless and AWS solutions.
I have the source code, deploy files, etc, from the last person in charge.
I run a before-deploy.js script to create all local files, check them to see if the updates went ok. Everything's fine.
But anytime I try to deploy using the simple command "serverless deploy", it fails printing this error :
CREATE_FAILED: MainStaticSite (AWS::S3::Bucket)
“mywebsite.com” already exists
I don’t really understand this error, as I know the website already exists but I just want to update it.
I tried more specific commands like :
serverless deploy -v --stage production --region eu-west-1
But this one only shows this output :
Framework Core: 3.10.1
Plugin: 6.2.0
SDK: 4.3.2
PS
And doesn't updates the website.
I changed the keys on AWS, maybe it's because of this ?
Looks like he doesn’t want to overwrite the existing files, but no idea why.
If someone has an answer or a lead.
Thank you :)

Calling vision (from google.cloud) Results in 'crash' in Log

Have been working on a GCP project involving OCR. Have attempted to follow the tutorial here, but the first function crashes when I try to upload a file to the trigger bucket. Moreover, cloud shell will not allow me to set the env variable GCP_PROJECT; it returns
ERROR: (gcloud.functions.deploy) ResponseError: status=[400], code=[Bad Request], message=[The request has errors
Problems:
environment_variables:
environment variable name GCP_PROJECT is reserved by the system: it cannot be set by users
]
Any suggestions?
I am not 100% sure, but after some work, I am guessing that the answer is that the .json file with the service account being used in the function had to be exported as GOOGLE_APPLICATION_CREDENTIALS in the gcloud SDK when deploying the function.
I got the same error when following this tutorial.
Changing
--set-env-vars "^:^GCP_PROJECT=my_proj:TRANSLATE_TOPIC
to
--project my_proj --set-env-vars "^:^TRANSLATE_TOPIC fixed it.
I have the same error.
I just follow their own tutorial and there is nothing special or customized.
Actually I got errors in every step of the tutorial and search the internet to fix it.
However I stuck on this one.

AWS CDK - how does one debug a hanging deploy?

There are times when I run cdk deploy and it will get to creating a ECS service and just hang because I did "something" wrong with my config --
55/57 Currently in progress: MyServiceFA17513E
Is there any way to get insight into what the problem is? It seems to take quite long to timeout (hour+?)
You can run your command with the verbose parameter to get more details
cdk deploy -vv

AWS code deploy error before install

I am getting following error while deploying using code deploy agent
/opt/codedeploy-agent/deployment-root/6d3f114b-72a9-4d1a-9d65-1227b6839916/d-FWIG1AI1M/deployment-archive/appspec.yml
The problem is the appspec.yml gets created in folder inside the current deployment id.
Please advise as what is wrong?
Thanks
Do you have the error log? The place where appspec file is used looks good to me, according to http://docs.aws.amazon.com/codedeploy/latest/userguide/reference-appspec-file.html