Giter Club home page Giter Club logo

Comments (8)

suzettewilliams avatar suzettewilliams commented on June 9, 2024 1

Thanks, yes, the promise js file is missing. I will add, and let you know the outcome.

from translation-server.

SevanBadal avatar SevanBadal commented on June 9, 2024

The previous deploy script copies over submodules into a new dir named package. It seems possible that your submodules weren't pulled in locally before deploying! Try running git submodule update --init --recursive before running locally and deploying.

See line 18 which copies the modules dir (containing multiple git submodules):

# Skip files that aren't required i.e. ".git"
cp -r config package/
cp -r modules package/
cp -r node_modules package/
cp -r src package/

from translation-server.

suzettewilliams avatar suzettewilliams commented on June 9, 2024

Thank you SevanBadal. I will follow your directions and I will let you know the outcome

from translation-server.

suzettewilliams avatar suzettewilliams commented on June 9, 2024

The modules were copied and the problem still persists. My lambda deploy file is shown below:

#!/bin/bash -e
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

if [ -z $1 ]; then
	echo "Usage: $0 config.env" >&2
	exit 1
fi

set -a
. "$dir/$1"
set +a

rm -rf package
mkdir package

# Skip files that aren't required i.e. ".git"
cp -r config package/
cp -r modules package/
cp -r node_modules package/
cp -r src package/

# Remove broken symlinks because "sam package" complains
find -L package/ -maxdepth 10 -type l -delete

j2 "$dir/lambda_template.yaml.j2" > "$dir/package/template.yaml"

sam package --template-file "$dir/package/template.yaml" --s3-bucket $deployment_bucket_name --output-template-file "$dir/package/package.yaml"
aws cloudformation deploy --template-file "$dir/package/package.yaml" --stack-name $stack_name --capabilities CAPABILITY_IAM

from translation-server.

SevanBadal avatar SevanBadal commented on June 9, 2024

Can you please paste the result of ls modules/translate here? We want to confirm that the translate directory is not empty.

from translation-server.

suzettewilliams avatar suzettewilliams commented on June 9, 2024
swilliams@LAPTOP-I0QMUR48:~/translation-lambda/translation-server$ ls modules/translate
src
swilliams@LAPTOP-I0QMUR48:~/translation-lambda/translation-server$ ls src
args.js            formats.js         proxy.js           textSearch.js   webEndpoint.js
cors.js            http.js            searchEndpoint.js  translation     webSession.js
debug.js           importEndpoint.js  server.js          translators.js  zotero.js
exportEndpoint.js  lambda.js          testEndpoint.js    utilities.js

from translation-server.

SevanBadal avatar SevanBadal commented on June 9, 2024

I'm not seeing promise.js in the contents of your modules/translate/src directory! This could be related to the error message you reported above which is complaining about not finding a module /var/task/modules/translate/src/promise:

I deployed the zotero translation-server on AWS lambda using your previously deleted lambda_deploy script. Every time I make a request via the API Gateway url the translation-server fails with a "Missing authentication token" The error logs show:

Lambda execution failed with status 200 due to customer function error: Error: Cannot find module '/var/task/modules/translate/src/promise'
Method completed with status: 502

from translation-server.

suzettewilliams avatar suzettewilliams commented on June 9, 2024

I am tryng to redeploy, by using the updated repository. but I am stuck at ./lambda_deploy: line 15: j2: command not found The jinjacli is installed jinja2 in ./env/lib/python3.8/site-packages (3.1.2). Prior to using the updated code, I deployed with the promise module, but the same error occurred, because the function was looking in /var/task/modules/translate/src/promise for the promise module, but the promise.js file was in my home folder/translation-server/modules/translate/src/promise*. I am thinking of creating a symbolic link. I am unsure if that will work, since I am still stuck at j2 command not found. Any thoughts about the J2 command?

from translation-server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.