How do I build and install a Puppet module locally from source? - build

I found a puppet module whose authors just added a bunch of modifications that I would otherwise have to make myself, manually.
This literally occurred 20 hours ago.
I have downloaded the master branch to a zip file, extracted it to my modules folder, and run puppet module build --verbose /etc/puppet/modules/arioch-redis, to no avail.
I understand that this is definitely not normal behavior, but I feel this question deserves some attention.
There is definitely a use case for using a module from source, especially in projects that move quickly, or rely on quick feedback.
I have done some research on this, and please feel free to ask, "have you looked into X" questions in the comments.
For instance, I looked over https://docs.puppetlabs.com/puppet/latest/reference/modules_publishing.html#build-your-module, but it seems mainly geared toward uploading a module to the Forge, rather than installing locally from source.
Plus, my attempt fails at the "Build Your Module" section.
All three of the following seem to answer this question with "install librarian-puppet", but given that we can write our own modules, it seems silly to have to use librarian-puppet to use the source code from a publicly available git repository to use a simple module:
Changing puppet module source (I'm looking for an answer to what happens after the OP would create the private repo in that answer. )
How to install a puppet file from a local repo with puppet module install (My Excuse: I don't need to use only the puppet module install tool. I can use other puppet tools, too.)
Using puppet module straight from a cloned repo (My Excuse: Answer does not seem relevant to this question.)
Installing a puppet module from a manifest script (My Excuse: Again, the best answer, which I think is perfect for that question, is "don't use Puppet for this, find a workaround." In this case, the workaround was to have Vagrant partially use Shell Provisioning.)
If this really is a duplicate, or a summary, please say so in the comments, and maybe I can explain. Edits welcome!
Do I need to hack the metadata.json contents?
Should I clone this repository somewhere and link it into my own temporary Forge account, or something?
Summary:
How might I get the veeeeerry latest build of the module, when it's passing in Travis on its Git repository, but before the Forge makes it available?

Puppet modules downloaded from the forge are still folders, the puppet module command is just untarring them and downloading dependencies with the API.
So your approach was close, you just need to make sure the folder has the right directory name:
So for your example:
$ puppet module list
/Users/foo/.puppet/modules
├── fiddyspence-sysctl (v1.1.0)
├── puppetlabs-apt (v1.8.0)
├── puppetlabs-aws (v1.0.0)
├── puppetlabs-nodejs (v0.7.1)
└── puppetlabs-stdlib (v4.6.0)
$ cd /Users/foo/.puppet/modules
$ ll
total 0
drwxr-xr-x 15 foo staff 510 Mar 17 2015 apt
drwxr-xr-x 18 foo staff 612 Mar 26 2015 aws
drwxr-xr-x 14 foo staff 476 Jan 22 2015 nodejs
drwxr-xr-x 17 foo staff 578 Apr 15 2015 stdlib
drwxr-xr-x 12 foo staff 408 Feb 9 2015 sysctl
$ wget https://github.com/arioch/puppet-redis/archive/master.zip
--2015-12-02 11:56:24-- https://github.com/arioch/puppet-redis/archive/master.zip
Resolving github.com... 192.30.252.130
Connecting to github.com|192.30.252.130|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://codeload.github.com/arioch/puppet-redis/zip/master [following]
--2015-12-02 11:56:24-- https://codeload.github.com/arioch/puppet-redis/zip/master
Resolving codeload.github.com... 192.30.252.144
Connecting to codeload.github.com|192.30.252.144|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 29509 (29K) [application/zip]
Saving to: 'master.zip'
master.zip 100%[==================================================>] 28.82K --.-KB/s in 0.1s
2015-12-02 11:56:25 (257 KB/s) - 'master.zip' saved [29509/29509]
$ unzip master.zip
Archive: master.zip
4fb33b960a09bfb459eff20ee112bfc9e0a1c096
creating: puppet-redis-master/
inflating: puppet-redis-master/.fixtures.yml
inflating: puppet-redis-master/.gitignore
extracting: puppet-redis-master/.puppet-lint.rc
inflating: puppet-redis-master/.travis.yml
inflating: puppet-redis-master/Gemfile
inflating: puppet-redis-master/LICENSE
inflating: puppet-redis-master/README.md
inflating: puppet-redis-master/Rakefile
creating: puppet-redis-master/manifests/
inflating: puppet-redis-master/manifests/config.pp
inflating: puppet-redis-master/manifests/init.pp
inflating: puppet-redis-master/manifests/install.pp
inflating: puppet-redis-master/manifests/params.pp
inflating: puppet-redis-master/manifests/preinstall.pp
inflating: puppet-redis-master/manifests/sentinel.pp
inflating: puppet-redis-master/manifests/service.pp
inflating: puppet-redis-master/metadata.json
creating: puppet-redis-master/spec/
creating: puppet-redis-master/spec/classes/
inflating: puppet-redis-master/spec/classes/redis_sentinel_spec.rb
inflating: puppet-redis-master/spec/classes/redis_spec.rb
extracting: puppet-redis-master/spec/spec.opts
inflating: puppet-redis-master/spec/spec_helper.rb
creating: puppet-redis-master/templates/
inflating: puppet-redis-master/templates/redis-sentinel.conf.erb
inflating: puppet-redis-master/templates/redis-sentinel.init.erb
inflating: puppet-redis-master/templates/redis.conf.erb
$ mv puppet-redis-master/ redis
$ ll
total 64
drwxr-xr-x 15 foo staff 510 Mar 17 2015 apt
drwxr-xr-x 18 foo staff 612 Mar 26 2015 aws
-rw-r--r-- 1 foo staff 29509 Dec 2 11:56 master.zip
drwxr-xr-x 14 foo staff 476 Jan 22 2015 nodejs
drwxr-xr-x 14 foo staff 476 Nov 30 15:10 redis
drwxr-xr-x 17 foo staff 578 Apr 15 2015 stdlib
drwxr-xr-x 12 foo staff 408 Feb 9 2015 sysctl
You'll notice it complains about missing dependancies.
$ puppet module list
Warning: Module 'puppetlabs-apt' (v1.8.0) fails to meet some dependencies:
'arioch-redis' (v1.1.3) requires 'puppetlabs-apt' (>= 2.0.1 <3.0.0)
Warning: Missing dependency 'stahnma-epel':
'arioch-redis' (v1.1.3) requires 'stahnma-epel' (>= 1.0.2 <2.0.0)
/Users/foo/.puppet/modules
├── arioch-redis (v1.1.3)
├── fiddyspence-sysctl (v1.1.0)
├── puppetlabs-apt (v1.8.0) invalid
├── puppetlabs-aws (v1.0.0)
├── puppetlabs-nodejs (v0.7.1)
└── puppetlabs-stdlib (v4.6.0)
As far as I'm aware: There's no way to resolve dependencies from a local module using Puppet's module command.
That's where librarian-puppet is comes in:
$ cd redis/
$ librarian-puppet install --path ../. --verbose
[Librarian] Ruby Version: 2.1.2
[Librarian] Ruby Platform: x86_64-darwin14.0
[Librarian] Rubygems Version: 2.4.8
[Librarian] Librarian Version: 0.6.3
[Librarian] Librarian Adapter: puppet
[Librarian] Librarian Adapter Version: 2.2.1
[Librarian] Project: /Users/foo/.puppet/modules/redis
[Librarian] Specfile: Puppetfile
[Librarian] Lockfile: Puppetfile.lock
[Librarian] Git: /opt/boxen/homebrew/bin/git
[Librarian] Git Version: 2.4.3
[Librarian] Git Environment Variables:
[Librarian] GIT_PS1_SHOWDIRTYSTATE=true
[Librarian] GIT_PS1_SHOWSTASHSTATE=true
[Librarian] GIT_PS1_SHOWUNTRACKEDFILES=true
[Librarian] GIT_PS1_SHOWUPSTREAM=auto
[Librarian] Pre-Cached Sources:
[Librarian] [:forge, "https://forgeapi.puppetlabs.com", {}]
[Librarian] Specfile /Users/foo/.puppet/modules/redis/Puppetfile not found, using defaults
[Librarian] Post-Cached Sources:
[Librarian] [:forge, "https://forgeapi.puppetlabs.com", {}]
[Librarian] The specfile is unchanged: nothing to do.
[Librarian] Install: dependencies resolved
[Librarian] Installing puppetlabs-stdlib/4.9.0 <https://forgeapi.puppetlabs.com>
[Librarian] Installing puppetlabs-apt/2.2.0 <https://forgeapi.puppetlabs.com>
[Librarian] Installing stahnma-epel/1.2.0 <https://forgeapi.puppetlabs.com>
$ puppet module list
/Users/petersouter/.puppet/modules
├── arioch-redis (v1.1.3)
├── fiddyspence-sysctl (v1.1.0)
├── puppetlabs-apt (v2.2.0)
├── puppetlabs-aws (v1.0.0)
├── puppetlabs-nodejs (v0.7.1)
├── puppetlabs-stdlib (v4.9.0)
└── stahnma-epel (v1.2.0)
If you don't want to use puppet-librarian, you could also just update those modules manually:
$ puppet module install puppetlabs-apt -v 2.0.1 --force
Notice: Preparing to install into /Users/petersouter/.puppet/modules ...
Notice: Downloading from https://forgeapi.puppetlabs.com ...
Notice: Installing -- do not interrupt ...
/Users/foo/.puppet/modules
└── puppetlabs-apt (v2.0.1)
$ puppet module install stahnma-epel -v 1.2.0 --force
Notice: Preparing to install into /Users/petersouter/.puppet/modules ...
Notice: Downloading from https://forgeapi.puppetlabs.com ...
Notice: Installing -- do not interrupt ...
/Users/foo/.puppet/modules
└── stahnma-epel (v1.2.0)

Related

SageMaker Studio Image - pip not found and no python 3 in terminal for Python 3 notebook instance

Launched Data Science Python 3 instance in the SageMaker Studio.
Launched a terminal from the Notebook menu "Launch terminal in current SageMaker image".
Tried to run pip but it says not found. Do I need to install pip by myself?
root#datascience-1-0-ml-t3-medium-1abf3407f667f989be9d86559395:~/# pip
bash: pip: command not found
Alto there is no Python3 available apparently from within the terminal.
root#datascience-1-0-ml-t3-medium-1abf3407f667f989be9d86559395:~# python3
bash: python3: command not found
root#datascience-1-0-ml-t3-medium-1abf3407f667f989be9d86559395:~# python --version
Python 2.7.16
root#datascience-1-0-ml-t3-medium-1abf3407f667f989be9d86559395:/usr/bin# ls -lrt | grep python
lrwxrwxrwx 1 root root 29 Mar 4 2019 pyversions -> ../share/python/pyversions.py
lrwxrwxrwx 1 root root 9 Mar 4 2019 python2 -> python2.7
lrwxrwxrwx 1 root root 7 Mar 4 2019 python -> python2
-rwxr-xr-x 1 root root 1056 Mar 4 2019 dh_python2
-rwxr-xr-x 1 root root 3689352 Oct 10 2019 python2.7
lrwxrwxrwx 1 root root 23 Oct 10 2019 pdb2.7 -> ../lib/python2.7/pdb.py
However, the notebook says it is Python3.
from platform import python_version
print(python_version())
---
3.7.10
And can run pip in the cell.
Appreciate any explanation what is going on.
SageMaker Studio image terminals use conda for package management. The data science notebook uses the base environment. You can use pip once you switch to base (also note that the python version is 3.7).
root#datascience-1-0-ml-t3-medium-xx:~# conda env list
# conda environments:
#
base * /opt/conda
root#datascience-1-0-ml-t3-medium-xx:~# conda activate base
(base) root#datascience-1-0-ml-t3-medium-xx:~# pip show pip
Name: pip
Version: 21.3.1
Summary: The PyPA recommended tool for installing Python packages.
Home-page: https://pip.pypa.io/
Author: The pip developers
Author-email: distutils-sig#python.org
License: MIT
Location: /opt/conda/lib/python3.7/site-packages
Requires:
Required-by:
(base) root#datascience-1-0-ml-t3-medium-1abf3407f667f989be9d86559395:~# python --version
Python 3.7.10
I work at AWS and my opinions are my own.
Was stuck in the same issue in Sagemaker notebook instance. Followed the guide here and resolved it by running:
%pip install matplotlib
Attaching the screenshot for your reference:

The repository ... does not have a Release file (Maxmind)

I am following this tutorial: Maxmind GeoLite2 & GeoIP Database Auto-Update | 2020
I launched an Ec2 AWS instance with the mautic application (debian 10).
I'm trying to install Geolip Maximind on my instance but without success.
Here are the problems:
When I execute the command add-apt-repository ppa:maxmind/ppa
I get the result:
More info: https://launchpad.net/~maxmind/+archive/ubuntu/ppa
Press [ENTER] to continue or ctrl-c to cancel adding it
gpg: keybox '/tmp/tmpxsjdtonq/pubring.gpg' created
gpg: /tmp/tmpxsjdtonq/trustdb.gpg: trustdb created
gpg: key DE1997DCDE742AFA: public key "Launchpad PPA for MaxMind" imported
gpg: Total number processed: 1
gpg: imported: 1
gpg: no valid OpenPGP data found.
When I execute the command apt update
I get the result:
Hit:1 http://security.debian.org/debian-security buster/updates InRelease
Hit:2 http://cdn-aws.deb.debian.org/debian buster InRelease
Hit:3 http://cdn-aws.deb.debian.org/debian buster-updates InRelease
Hit:4 http://cdn-aws.deb.debian.org/debian buster-backports InRelease
Ign:5 http://ppa.launchpad.net/maxmind/ppa/ubuntu impish InRelease
Err:6 http://ppa.launchpad.net/maxmind/ppa/ubuntu impish Release
404 Not Found [IP: 91.189.95.85 80]
Reading package lists... Done
E: The repository 'http://ppa.launchpad.net/maxmind/ppa/ubuntu impish Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
I didn't think it was useful to continue the tutorial because of these errors. I need your precious help to correct them.
If you are running Debian then you just have to install geoip-bin and geoip-database and for the updates you install geoipupdate. They are all in the standard apt repository.
You do not need to add the maxmind repository.
apt install geoip-bin geoip-database geoipupdate
Note that depending what you plan to do you may need also other packages for your perl php lua apache lighttp etc ... Since you don't want to tell us what you have in mind, I can't tell you more than that.
There are several packages there ...
root#linux:~# apt policy geoipupdate
geoipupdate:
Installiert: 3.1.1-1
Installationskandidat: 3.1.1-1
Versionstabelle:
*** 3.1.1-1 500
500 http://ftp.debian.org/debian buster/contrib amd64 Packages
100 /var/lib/dpkg/status
2.5.0-1~bpo9+1 100
100 http://ftp.debian.org/debian stretch-backports/contrib amd64 Packages
2.3.1-1 500
500 http://ftp.debian.org/debian stretch/contrib amd64 Packages
The standard apt repositories are :
deb http://ftp.debian.org/debian/ buster main contrib non-free
deb-src http://ftp.debian.org/debian/ buster main non-free
deb http://security.debian.org/debian-security buster/updates main contrib non-free
deb-src http://security.debian.org/debian-security buster/updates main non-free
deb http://ftp.debian.org/debian buster-backports main contrib
deb-src http://ftp.debian.org/debian buster-backports main contrib
add them to your /etc/apt/sources.list and then try again

Deploying NestJS application on Elastic Beanstalk

I am trying to deploy my NestJS application to AWS elastic beanstalk, but did not had any success, can someone please write step by step how can I achieve that?
Full explanation:
I have a nestjs app with typeorm but didn’t configured it to work with RDS, so we will leave it for now (maybe there is a connection, idk).
First of all I made a CodePipline that when I am pushing new version to my github repo it automatically deploying the whole repo to my eb instance that works on node 12.x.
Now, I want that on every git push, the instance will install the dependencies, build the nest app, and start the server from the /dist/main.js.
I have added a Procfile with:
web: npm install && npm run build && npm run start:prod
I have also added PORT environment variable on EB that configured on main.ts and when not found to use 8080.
And my package.json scripts are like a newly created nest app:
"scripts": {
"prebuild": "rimraf dist",
"build": "nest build",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"start": "nest start",
"start:dev": "nest start --watch",
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/main",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"test": "jest",
"test:watch": "jest --watch",
"test:cov": "jest --coverage",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test:e2e": "jest --config ./test/jest-e2e.json"
}
When deploying I see in the logs that it did something like this:
Jan 23 20:01:14 web: > app#0.0.1 start /var/app/current
Jan 23 20:01:14 ip-172-31-17-171 web: > sudo npm i -g #nestjs/cli && node dist/main
Jan 23 20:01:14 web: We trust you have received the usual lecture from the local System
Jan 23 20:01:14 web: Administrator. It usually boils down to these three things:
Jan 23 20:01:14 web: #1) Respect the privacy of others.
Jan 23 20:01:14 web: #2) Think before you type.
Jan 23 20:01:14 web: #3) With great power comes great responsibility.
Jan 23 20:01:14 web: sudo: no tty present and no askpass program specified
Jan 23 20:01:14 web: npm ERR! code ELIFECYCLE
Jan 23 20:01:14 web: npm ERR! errno 1
Jan 23 20:01:14 web: npm ERR! app#0.0.1 start: `sudo npm i -g #nestjs/cli && node dist/main`
Jan 23 20:01:14 web: npm ERR! Exit status 1
Jan 23 20:01:14 web: npm ERR!
Jan 23 20:01:14 web: npm ERR! Failed at the app#0.0.1 start script.
So I am getting 502 when entering the env url.
So maybe it is a permission issue with npm? Or I need to deploy on some way only the /dist folder?
What do you think the problem is?
It is my first time trying to deploy a backend server to eb :)
I got stuck with the deploying the nestjs app to AWS elastic beanstalk for a while so that I decide make the guide here. I make the deploy guide step by step here for deploying the simple app.
The reason WHY the deploying is usually FAILED because it does not know NEST dependencies (it does not install dev dependencies) and Typescript code which need to compile before uploading to server.
In my case, Use the compression for making the zip file (you can use the command line eb but try to use this first for simple).
Firstly, Preparing the zip file, this is really IMPORTANT for avoiding the FAILED while it is deploying.
You need to make dist folder. For doing this, we remove the dist folder first and run the command nest build (* this one do the tsc for compile Typescript for us).
Now, we have the dist folder, the next thing we need to do is copying the package.json ( * this one installing the DEPENDENCIES for us ) into dist folder to let server know installing the dependencies that we do not bring the node_module here.
In package.json, yarn start to run nest start but the AWS does not know Nest command so that we need to point it out by using node main.js (this file is in dist file, you need to make the path to main.js correctly). For doing this, we create the Procfile (reference this) and add the conntent is web: node src/main.js. Remember copying it into the dist file.
Compressing file correctly as this
Secondly, from AWS console creating the application or environment then uploading the zip file and get successful status. If not, check the log file to know why it failed. Maybe it does not the nest command, etc...
Hoping this guide will help you.
Cheer!
I was stuck with the following EBS eb-engine.log error:
"Instance deployment: You didn't include a 'package.json' file in your
source bundle. The deployment didn't install a specific Node.js
version."
"Instance deployment failed to generate a 'Procfile' for Node.js.
Provide one of these files: 'package.json', 'server.js', or 'app.js'.
The deployment failed."
Using all previous answers, the following works for me with CodePipeline and EBS:
buildspec.yml
version: 0.2
phases:
install:
commands:
- npm install
build:
commands:
- npm run build
post_build:
commands:
- cp -R node_modules/ dist/node_modules # nodejs needs this
- cp Procfile dist/Procfile # EBS needs this
artifacts:
files:
- "**/*"
discard-paths: no
base-directory: dist
Procfile
web: node main.js
The way it works is that CodeBuild handles Nest building, and CodeDeploy only deploys what's in dist/
Node will need node_modules so post build I copy it to dist/
But EBS complains there's no package.json or any file it recognizes in dist/, and since Procfile is usually at root, copy it so EBS finds it and starts by using node main.js
"build": "nest build && cp package.json dist/",
"postbuild": "cd dist && zip ../dist.zip -r * .[^.]*",
"start": "node main.js"
Modifying just these three scripts, it works for me. Procfile is not required.
Finally in the root folder of the project, the dist.zip file that was generated I upload it to Amazon
Change your artifacts to copy everything, so that Codebuild can copy your node_modules, package.json, dist folder automatically.
artifacts:
files:
- "**/*"
Then in your package.json, change the start command to production by default -
"start": "node dist/main"
Here is my buildspec.yml and package.json which works fine on Nestjs deployment on Elastic beanstalk
The mysterious part is this: where is sudo npm i -g #nestjs/cli coming from?
I'm also deploying to Elastic Beanstalk but I only have web: npm run start:prod in my Procfile. The build happens in CI, for that I'm using GitHub Actions. The general outline of the workflow file is as follows:
Checkout
Setup Node
Install dependencies and build app
Generate deployment ZIP archive
Upload deployment archive to Elastic Beanstalk
I suggest you make your Procfile be like mine, run the build script locally, generate the deployment archive using something like zip -r deployment.zip dist package* Procfile and upload it to Elastic Beanstalk and see what the outcome is.

Serverless plugin "serverless-offline" not found. Make sure it's installed and listed in the "plugins" section of your serverless config file

When I deploy my SLS project, I get the following error:
Serverless plugin "serverless-offline" not found. Make sure it's
installed and listed in the "plugins" section of your serverless
config file
But I did install the plugin serverless-offline correctly, please can someone help me fix it.
Here is my serverless.yml file:
service: email-sender
provider:
name: aws
runtime: nodejs4.3
functions:
send:
handler: handler.send
events:
- http:
path: submissions
method: post
response:
headers:
Content-Type: "text/json"
cors:
origins:
- '*'
package:
exclude:
- node_modules/**
include:
- node_modules/serverless-offline/**
plugins:
- serverless-offline
Serverless offline is a plugin to run only on your development machine, not in production.
To enable it add the following to serverless.yml:
plugins:
- serverless-offline
and remove the following lines
include:
- node_modules/serverless-offline/**
also check your package.json and make sure it is a devDependencies.
Please ensure that serverless-offline package is included in dev dependencies, if not then add it
"serverless-offline": "3.20.2"
and run,
npm install --save-dev
This solved my issue.
To resolve this error while running an automated CI pipeline or locally, try the following:
- npm config set prefix /usr/local
- npm install -g serverless
- npm install serverless-offline -g
- npm install --save-dev
- serverless deploy --stage production --verbose
Also, check your package.json and ensure the serverless-offline package is included in devDependencies.
This fixed the issue for me.
Happy Serverless!
The error is resolved by installing the package
npm install serverless-offline -g
If the serverless package is not added, do add that:
npm i -g serverless
The terminal commands and the console logs shown below:
keerthipriyagkurtakoti#Keerthipriyas-MacBook-Pro aws-node-express-api % npm start
> aws-node-express-api#1.0.0 start /Users/keerthipriyagkurtakoti/Desktop/krishnaWorkspace/Educative/educative/aws-node-express-api
> nodemon --exec serverless offline
[nodemon] 2.0.19
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `serverless offline`
Environment: darwin, node 14.16.1, framework 3.21.0, plugin 6.2.2, SDK 4.3.2
Docs: docs.serverless.com
Support: forum.serverless.com
Bugs: github.com/serverless/serverless/issues
Error:
Serverless plugin "serverless-offline" not found. Make sure it's installed and listed in the "plugins" section of your serverless config file. Run "serverless plugin install -n serverless-offline" to install it.
[nodemon] app crashed - waiting for file changes before starting...
^C% keerthipriyagkurtakoti#Keerthipriyas-MacBook-Pro aws-node-express-api % npm install serverless-offline -g
npm WARN deprecated querystring#0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN serverless-offline#8.8.1 requires a peer of serverless#^1.60.0 || 2 || 3 but none is installed. You must install peer dependencies yourself.
+ serverless-offline#8.8.1
added 192 packages from 267 contributors in 34.928s
keerthipriyagkurtakoti#Keerthipriyas-MacBook-Pro aws-node-express-api % npm start
> aws-node-express-api#1.0.0 start /Users/keerthipriyagkurtakoti/Desktop/krishnaWorkspace/Educative/educative/aws-node-express-api
> nodemon --exec serverless offline
[nodemon] 2.0.19
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `serverless offline`
Starting Offline at stage dev (us-east-1)
Offline [http for lambda] listening on http://localhost:3002
Function names exposed for local invocation by aws-sdk:
* user: aws-node-express-api-dev-user
* test: aws-node-express-api-dev-test
* authentication: aws-node-express-api-dev-authentication
* postFeed: aws-node-express-api-dev-postFeed
┌──────────────────────────────────────────────────────────────────────────────────┐
│ │
│ ANY | http://localhost:4000/dev/user/{any*} │
│ POST | http://localhost:4000/2015-03-31/functions/user/invocations │
│ ANY | http://localhost:4000/dev/test/{any*} │
│ POST | http://localhost:4000/2015-03-31/functions/test/invocations │
│ ANY | http://localhost:4000/dev/auth/{any*} │
│ POST | http://localhost:4000/2015-03-31/functions/authentication/invocations │
│ ANY | http://localhost:4000/dev/social/{any*} │
│ POST | http://localhost:4000/2015-03-31/functions/postFeed/invocations │
│ │
└──────────────────────────────────────────────────────────────────────────────────┘
Server ready: http://localhost:4000 🚀
Enter "rp" to replay the last request
Error is shown in the picture below
The error being addressed
in the picture below:
I encountered a similar issue on bitbucket pipelines. I fixed the issue (after many trials and errors) by updating "script" section of your bitbucket-pipelines.yml file with the following:
script:
- npm install -g npm
- npm install --save-dev
- pipe: atlassian/serverless-deploy:1.1.1
variables:
AWS_ACCESS_KEY_ID: $KEY_DEFINED_ON_BITBUCKET
AWS_SECRET_ACCESS_KEY: $KEY_DEFINED_ON_BITBUCKET
Also, check your package.json and ensure the serverless-offline package and any other plugins in the serverless.yml file are included in devDependencies.
Big thanks to K Manoj Kumar's answer for giving me a clue.
If you are not using bitbucket pipeline, I feel replacing the "pipe" section on the bitbucket-pipelines.yml file with something like npm run deploy and adding "deploy": "serverless deploy" to the "scripts" section on your package.json will work.
I kept getting this error as I had the NODE_ENV set to "production" in my local dev environment.
serverless-offline does not work with this I believe. So set NODE_ENV to "development" or something that's not "production"

reviewboard install error on Solaris

I'm trying to install reviewboard on Solaris 10, but I have this error message below and can not get rid of it. The environment is Solaris 10, python 2.4.
bash-3.2# easy_install ReviewBoard?-1.5.7
Processing ReviewBoard?-1.5.7
Running setup.py -q bdist_egg --dist-dir /home/fujita/Downloads/ReviewBoard-1.5.7/egg-dist-tmp-C1FAsb
warning: no files found matching '*' under directory 'locale'
no previously-included directories found matching 'docs/*/_build'
no previously-included directories found matching 'reviewboard/htdocs/media/uploaded/images'
ReviewBoard? 1.5.7 is already the active version in easy-install.pth
Installing rb-site script to /usr/bin
Installing rbssh script to /usr/bin
Installed /usr/lib/python2.4/site-packages/ReviewBoard-1.5.7-py2.4.egg
Processing dependencies for ReviewBoard?==1.5.7
Searching for Django>=1.1.3
Reading http://pypi.python.org/simple/Django/
No local packages or download links found for Django>=1.1.3
Best match: None
This error tells me that there should be Django installed on, I think that Django was already installed successfully.
bash-3.2# cd Django-1.3.5
bash-3.2# python setup.py install
running install
running build
running build_py
running build_scripts
running install_lib
running install_scripts
changing mode of /usr/bin/django-admin.py to 755
running install_data
bash-3.2# ls -lt /usr/lib/python2.4/site-packages/
drwxr-xr-x 17 root root 19 Aug 19 18:03 django
Question is why during installing reviewboard it can't find Django which is already installed?
Does anyone have any idea what kind of situation I'm in and any comments would help.
Thank you very much.
TomoyaFujita.