AWS Amplify build failing - Failed to get profile: Profile configuration is missing for: amplify - aws-amplify

I have an AWS-Amplify project that had been building without a problem but is now failing.
# Starting phase: build
2021-11-20T00:40:02.506Z [INFO]: [31mFailed to get profile: Profile configuration is missing for: amplify[39m
2021-11-20T00:40:02.564Z [ERROR]: !!! Build failed
2021-11-20T00:40:02.564Z [ERROR]: !!! Non-Zero Exit Code detected
2021-11-20T00:40:02.564Z [INFO]: # Starting environment caching...
2021-11-20T00:40:02.565Z [INFO]: # Environment caching completed
Terminating logging...
The problem seemed to start after I made an error doing a pull request (in the wrong direction!), however, the problem has persisted despite reverting back to an earlier commit.
I have also ensured all the Amplify code is up to date amplify pull, as well as trying amplify configure and amplify init on my development machine.
Other posts that describe problems with 'Profile Configuration' seem to be related to the development machine and setting up the CLI. This failure is happening when I try to build on AWS using continuous deploys, building locally works fine.

so i got it to work.
Just delete the aws-exports.json and the amplify folder.
Then run the command from amplify which is something like:
amplify pull --appId XXXXXXXXXXX --envName dev
After a few mins, it will prompt you to select:
AWS PROFILE
AWS KEYS
select AWS KEYS
enter credentials for a programmatic user and it should be fine

Related

AWS Codedeploy Wordpress deployment fails due to PHP version change in buildspec file

I am running my Wordpress site hosted in AWS EC2 [Amazon Linux2 AMI].
I have a pipeline to deploy the latest source from Github.
The codebuild buildspec file is as follow: [Mentioned only related part]
version: 0.2
phases: install:
runtime-versions: php: 7.4
Codebuild project in cloudformation is like this:
Image: 'aws/codebuild/amazonlinux2-x86_64-standard:3.0'
Using above configuration, deployment is going without problem and problem happens when I update like below: [Mentioned only related part]
In cfn template:
Image: 'aws/codebuild/amazonlinux2-x86_64-standard:4.0'
In buildspec: runtime-versions: php: 8.1
Validation script in deployment hooks runs some validation commands to check RDS connection and it fails:
LifecycleEvent - ValidateService Script - deploy_hooks/validate_service.sh [stdout]OK SO FAR
[stderr]mysqlcheck: Got error: 1045: Access denied for user 'root'#'10.37.253.207' (using password: NO) when trying to connect
After deployment, I loginto the ec2 instance and below WP cli command fails as well:
$ wp db check
These above problems does not occur when I roll back to previous state of the PHP version.
In cfn template:
Image: 'aws/codebuild/amazonlinux2-x86_64-standard:3.0'
In buildspec:
runtime-versions: php: 7.4
What might be the problem ?
Reference:
https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-available.html
https://docs.aws.amazon.com/codebuild/latest/userguide/available-runtimes.html#linux-runtimes
** UPDATE:
Codedeploy is failing to deploy DB endpoint , password and other information in wp-config.php file when codedeploy is executed by codepipeline.
If I terminate the ec2 instance, the auto-scaling will launch a new instance for me and deployment is triggered by the codedeploy and the deployment is success. I can access the site.
Does it mean that executing Codedeploy through Codepipeline is the problem?

Serverless Stuck Unable to Create Domain

I have a Lambda service that was created with Serverless. I recently upgraded to Serverless 3. (3.22.0 specifically.) I'm also using serverless-offline 8.8.1 and serverless-domain-manager 4.2.3.
It seems to be "stuck" in a state where the domain cannot be deleted or re-created.
After the upgrade, publishing to my prod stage would fail with:
Serverless Domain Manager: Info: api-prod.example.com: Found apiId: pnedwg0m9b
Serverless Domain Manager: Error: api-prod.example.com: ConflictException: Base path already exists for this domain name
Serverless Domain Manager: Error: api-prod.example.com: Error: Error: api-prod.example.com: Unable to create basepath mapping.
...
Error: Error: Unable to setup base domain mappings for api-prod.example.com
The domain settings in serverless.yml look like this:
custom:
customDomain:
domainName: api-${opt:stage, 'dev'}.example.com
basePath: ''
stage: ${self:provider.stage}
createRoute53Record: true
After searching online, I thought the issue might be that the domain was created with an older version of serverless, so I manually deleted it in the Route53 section of the AWS console, then waited overnight. It doesn't appear in the console now.
I tried to re-create it by doing both:
Having createRoute53Record: true in the serverless.yml and running:
SLS_DEBUG=* serverless deploy --verbose --stage prod
This gives the same "unable to setup base domain mapping..." error as before.
... and also manually creating it:
SLS_DEBUG=* serverless create_domain --verbose --stage prod
That just gives the following error, despite the fact that the domain is not visible in the AWS console:
Custom domain api-prod.example.com already exists.
If I try to delete it via serverless, it also throws an error:
SLS_DEBUG=* serverless delete_domain --verbose --stage prod
Serverless Domain Manager: Error: api-prod.example.com: InvalidChangeBatch: [Tried to delete resource record set [name='api-prod.example.com.', type='A'] but it was not found, Tried to delete resource record set [name='api-prod.example.com.', type='AAAA'] but it was not found]
Serverless Domain Manager: Error: api-prod.example.com: Error: Error: Failed to DELETE A Alias for api-prod.example.com
Some other notes:
The "development" stage doesn't result in any errors when deploying. (I created the domain with the create_domain command, but even with createRoute53Record:true, it deploys without error.)
I've tried bumping serverless-domain-manager to 6.1, but that didn't help.
The api-prod.example.com is not present in neither Route53 nor in API Gateway>Custom domain names.
Not sure if it's relevant but this same API was exposed by both api-prod.example.com and api.example.com. I'm not sure how the api.example.com one was created.

Symfony console output creates extra unwanted characters

i got this weird error, where every output in the console with symfony creates some extra characters. The following is the output after a basic symfony in the console.
$ symfony
←[32mSymfony CLI←[39m version ←[33mv4.22.0←[39m (c) 2017-2021 Symfony SAS
Symfony CLI helps developers manage projects, from local code to remote infrastructure
These are common commands used in various situations:
←[33mWork on a project locally←[39m
←[32mnew←[39m Create a new Symfony project
←[32mserve←[39m Run a local web server
←[32mserver:stop←[39m Stop the local web server
←[32msecurity:check←[39m Check security issues in project dependencies
←[32mcomposer←[39m Runs Composer without memory limit
←[32mconsole←[39m Runs the Symfony Console (bin/console) for current project
←[32mphp, pecl, pear, php-fpm, php-cgi, php-config, phpdbg, phpize←[39m Runs the named binary using the configured PHP version
←[33mManage a project on Cloud←[39m
←[32mlogin←[39m Log in with your SymfonyConnect account
←[32minit←[39m Initialize a new project using templates
←[32mlink←[39m Link current git repository to a SymfonyCloud project
←[32mprojects←[39m List active projects
←[32menvs←[39m List environments
←[32menv:create←[39m Create an environment
←[32mtunnel:open←[39m Open SSH tunnels to the app's services
←[32mssh←[39m Open an SSH connection to the app container
←[32mdeploy←[39m Deploy an environment
←[32mdomains←[39m List domains
←[32mvars←[39m List variables
←[32muser:add←[39m Add a user to the project
Show all commands with ←[32msymfony.exe help←[39m,
Get help for a specific command with ←[32msymfony.exe help COMMAND←[39m.
As you can see, I get this ←[33m here and there. Any help is gratefully accepted. Please let me know if you need any additional information from me.
$ bin/console --version
Symfony 5.2.1 (env: dev, debug: true)

Can't serve firebase functions

I am trying to follow this tutorial from Firebase Web Codelab, but I am facing a problem at step 5: after running the command firebase serve, I do not get the expected response
Listening at http://localhost:5000, but instead I get:
i functions: Preparing to emulate functions.
i hosting: Serving hosting files from: ./
+ hosting: Local server: http://localhost:5000
which is bad because functions are not being served, although ⚠ functions: Failed to emulate api is not prompted, it remains "preparing to emulate functions" ad infinitum.
More information: CLI Version: 3.18.4
Platform: win32
Node Version: v6.12.3 and I already tried going to ~/.config/configstore/ and deleting the #Google-Cloud folder in order to restart the whole process.
I'm pretty sure you are in the right track, the difference between the expected message (Listening at http://localhost:5000) and the message you get (hosting: Local server: http://localhost:5000) is because you are using the new version of the CLI (v3.18.4) but the codelab chapter is not updated to reflect the new change in the logging message.
You can see the difference in the source-code firebase-tools v2.2.1 where it displays
Listening at http://<HOST>:<PORT>
and in firebase-tools v3.18.4 it displays
hosting: Local server: http://<HOST>:<PORT>
And for the functions emulation, as you are in step5, you don't have yet functions, see functions in the codelab source code.

(Meteor) Mup deploy "read ECONNREST Error"

I don’t know what is going on.
I reinstalled my Computer and updated Meteor. I had some permission problems in a earlier problem I could fix that tho. Meteor is normally running if I don't want to deploy it. Deploying used to work just fine btw.
mup.cmd deploy --settings settings.json
Building App Bundle Locally
Started TaskList: Pushing Meteor App
[82.165.207.55] - Pushing Meteor App Bundle to the Server
[82.165.207.55] - Pushing Meteor App Bundle to the Server: SUCCESS
[82.165.207.55] - Prepare Bundle
[82.165.207.55] - Prepare Bundle: SUCCESS
Started TaskList: Configuring App
[82.165.207.55] - Pushing the Startup Script
[82.165.207.55] - Pushing the Startup Script: SUCCESS
[82.165.207.55] - Sending Environment Variables
[82.165.207.55] - Sending Environment Variables: SUCCESS
Started TaskList: Start Meteor
[82.165.207.55] - Start Meteor
events.js:183
throw er; // Unhandled ‘error’ event
^
Error: read ECONNRESET
at _errnoException (util.js:1022:11)
at TCP.onread (net.js:615:25)
What does that mean? I couldn’t find any solution for my problem online. Do you know what is wrong?
This error can happen if your IP address cannot SSH. Make sure your IP
hasn't changed, or change your rules/IP in the security groups of the
service you are using.
There was another case of this recently here mup setup : Error: Timed out while waiting for handshake
But I don't think he sorted it out. He has also reported it on the mup issues list
You can also enable debugging and set mup to be verbose like this:
DEBUG=mup* mup <command> --verbose
(docs at http://meteor-up.com/docs.html)

Resources