localstack start command is throwing exception - amazon-web-services

I tried to install localstack to test my lambda function, which uses dynamodb, sqs services.
To test this lambda function I installed localstack and followed the steps, which they gave in Readme.md file.
But when I tried to start localstack service by running "localstack start" command, it ends with below exception.
I have used "pip install localstack" command for installation
localstack exception while running it
Exception:
sfanish#fanish-PC MINGW64 /c/Python27/Scripts
$ localstack start
$ localstack start 2017-12-27T14:37:50:INFO:localstack.services.install:
Downloading and installing local Elasticsearch server.
This may take some time. Starting local dev environment. CTRL-C to quit.
ERROR: 'mkdir -p C:\python27\lib\site-packages\localstack/infra': The syntax of the command is incorrect.
I am using windows10 64-bit machine, Python2.7. Any help will be great :)

The error is due to the fact that the path contains both '/' and '\'. Windows even with MINGW64 is not well supported by localstack.
Solutions:
Try the last version of localstack/localstack.
Fix the issue in localstack code.
Use a virtual environment (Virtual Box, Hyper-V, Docker) that support fully the GNU/Linux syntax.

Related

AWS Codebuild Installing Upgraded Version of Package but Old Version Still Detected/Used

I have a Django App deployed via AWS' elastic beanstalk, that uses the CodePipeline service to build. As part of that pipeline, the CodeBuild service is used to build the app that gets deployed to the ElasticBeanstalk environment.
The build failed, sending the following error message:
django.core.exceptions.ImproperlyConfigured: SQLite 3.9.0 or later is required (found 3.7.17).
Per Amazon's own package version listing I realize that is expected given the older version is intended to be on the Amazon Linux 2 distro.
Ok. I wrote a shell script to download the latest version of SQLite and build from scratch, but I'm still getting the same issue.
In the buildspec.yaml file I have the following:
...
post_build:
commands:
- echo "beginning post-build phase..."
- bash get_sqlite.sh
- echo "sqlite version -- $(sqlite3 --version)"
- python manage.py makemigrations
...
In the CodeBuild logs, I can see the result of the echo command as such:
sqlite version -- 3.40.1 2022-12-28
Yet, the build fails and the logs still show the following error:
django.core.exceptions.ImproperlyConfigured: SQLite 3.9.0 or later is required (found 3.7.17).
Any idea what further steps need to be taken for the updated version to be detected rather than the previous one?
I think you need to move your sqlite command to bin directory in linux.
- mv sqlite /usr/local/bin/
Even though package has been updated but linux reads PATH ( env variable to find the commands ) and still it is finding the old version of the command, that is hwy you need to replace the old sqlite command with the new version in bin directory

Problem with aws cdk on Windows 10 Home Edition (Code: 800A03F6 Source: Compilation Error in Microsoft JScript)

I am installing aws-cdk on windows 10 home edition using powershell as administrator.
After successful installation and calling cdk - version, I keep getting error messages from the Windows Script Host:
Script
C:\Users..\ApData\Roaming\npm\node_modules\aws-cdk\bin\cdk.js
line 1
Character 1
...
Code: 800A03F6
Source: Compilation Error in Microsoft JScript
To solve the problem
I tried npx -p aws-cdk cdk --version.
I uninstalled node and aws-cdk, restarted windows and reinstalled everything.
Everything without success.
Error 800A03F6 can mean anything and only occurs in connection with cdk --version command. I don't have a proxy and have used an antivirus program.
I just fixed this problem by changing the path in the environment variable:
https://stackoverflow.com/a/67566915/12408270
change environment variable PATH to:
C:\Users\${your_username}\AppData\Roaming\npm

command not found when trying to deploy to AWS Elastic Beanstack

When trying to set up AWS Elastic Beanstack for my Django project following this tutorial:
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-django.html
once I get to running
eb create django-env
I get this error:
warning: CRLF will be replaced by LF in .gitignore.
The file will have its original line endings in your working directory.
Creating application version archive "app-2f30-181013_230403".
ERROR: CommandError - An error occurred while handling git command.
Error code: 1 Error: C:\Program Files\Git\mingw64/libexec/git-core\git-submodule: line 7: basename: command not found
C:\Program Files\Git\mingw64/libexec/git-core\git-submodule: line 7: sed: command not found
C:\Program Files\Git\mingw64/libexec/git-core\git-submodule: line 18: .: git-sh-setup: file not found
Any ideas what the issue is here? is AWS Elastic Beanstack unusable from Windows?
You have a Windows path and program compatibility problem.
The EB CLI works just fine on Windows. I use it almost everyday on many corporate systems for different customers. This assumes that everything is installed and setup correctly.
1) Make sure that you have installed the Windows native version of Git. Install from this location:
Downlading Git
2) Make sure that the Windows native version of Git is before Mingw in your Windows search path. Otherwise the wrong program will be loaded and then all the Mingw environment and dependencies will mess everything up.
3) Make sure that the latest version of EB CLI is installed (do this last). Follow these steps to repair your current installation. Depending on what you have setup, just installing EB CLI may be enough.
Install Python, pip, and the EB CLI on Windows

Running AWS SAM projects locally get error

I am trying to run an AWS Lambda project locally on Ubuntu. When I run the project with AWS SAM Local it shows me this error: Error: Running AWS SAM projects locally requires Docker. Have you got it installed?
I had trouble installing it on Fedora.
When I followed the Docker postinstall instructions I managed to get past this issue.
https://docs.docker.com/install/linux/linux-postinstall/
I had to:
Delete the ~/.docker directory;
Create the "docker" group;
Add my user to the "docker" group;
Logout and back in again;
Restart the "docker" daemon.
I was then able to run the command:
sam local start-api
If you want to run local sam-cli, you have first install docker from docker official website then run sudo sam local start-api. Note that sudo is necessary for running local developer with needed privileges.
This error mostly arises due to lack of admin privilege to use docker. Just add sudo to your command. This will work.
eg: sudo sam local start-api --region eu-west-3
We are working on Mac and were seeing same message when using an older version of Docker (1.12.6). Have since updated to a newer (but not latest) version 17.12.0-ce-mac49 and it is now fine.
Another cause for this is this recent issue within Docker for Mac.
A quick workaround, as specified in the issue itself, is to run SAM with:
$ DOCKER_HOST=unix://$HOME/.docker/run/docker.sock sam local start-api
You don't need to run SAM as root.
I am using colima for docker on mac with intel chip. and faced this error. was able to resolve it by adding DOCKER_HOST in .zshrc file
vi ~/.zshrc
paste export DOCKER_HOST="unix://$HOME/.colima/docker.sock" in the .zshrc file
escape :wq

Installing Jenkins on AWS EC2

I am running into an issue with the install wizard with Jenkins when following a Set Up a Jenkins Build Server tutorial from Amazon.
My EC2 instance is a t2.small. It was a t2.micro until I saw this SO post so I switched it to a t2.small. It doesn't appear to be a memory issue. I am getting an error when creating my initial user or trying to Continue as admin.
When inspecting the element, trying to Save and Finish when creating an initial user, POST http://<domain>:8080/setupWizard/createAdminUser errors out with a ERR_CONNECTION_RESET error. (I don't see anything in /var/log/jenkins/jenkins.log about this failure either)
I am running java 1.8 and I've tried with Jenkins 2.71-1.1 and Jenkins 2.61-1.1
openjdk version "1.8.0_131"
OpenJDK Runtime Environment (build 1.8.0_131-b11)
OpenJDK 64-Bit Server VM (build 25.131-b11, mixed mode)
I grepped the error log and only found one log pertaining to errors (but I'm not sure this is related):
Jul 24, 2017 11:09:50 PM hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope$1 error
INFO: Failed to instantiate optional component hudson.plugins.build_timeout.operations.AbortAndRestartOperation$DescriptorImpl; skipping
I created a CDK to provision a Jenkins service in AWS. have a try
https://github.com/seraphjiang/jenkinscdk
Install the certificates-
sudo apt install ca-certificates
then, Try Updating & Upgrading the packages-
sudo apt upgrade
sudo apt update
Then follow the link to install the Jenkins :)
https://www.digitalocean.com/community/tutorials/how-to-install-jenkins-on-ubuntu-18-04