OWASP / DVSA

a Damn Vulnerable Serverless Application

Home Page:http://dvsa.cloud (coming soon)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

got "[ERROR] DVSA backend does not work properly. Try to delete cache and re-login."

lucadidomenico opened this issue · comments

After deploy the application, I created a new user and logged in. After log in, the application shows a popup with the error message: "[ERROR] DVSA backend does not work properly. Try to delete cache and re-login."

I have investigated and this happens because the POST request to https://6u6eaiz6kk.execute-api.us-east-1.amazonaws.com/user/order return a 500 status code error, with the following response headers:

x-amzn-errortype: InternalServerErrorException
x-cache: Error from cloudfront

By examining the logs, it is caused by some nodejs missing dependencies. Has any other got this error? How to fix the missing dependencies error?

are you using master?

Yes, I'm using master.

Can you please paste the function's logs from CloudWatch logs?

{
"errorType": "Runtime.ImportModuleError",
"errorMessage": "Error: Cannot find module 'node-serialize'\nRequire stack:\n- /var/task/backend/src/functions/order-api/order-manager-js.js\n- /var/runtime/UserFunction.js\n- /var/runtime/index.js",
"trace": [
"Runtime.ImportModuleError: Error: Cannot find module 'node-serialize'",
"Require stack:",
"- /var/task/backend/src/functions/order-api/order-manager-js.js",
"- /var/runtime/UserFunction.js",
"- /var/runtime/index.js",
" at _loadUserApp (/var/runtime/UserFunction.js: 100:13)",
" at Object.module.exports.load (/var/runtime/UserFunction.js:140:17)",
" at Object. (/var/runtime/index.js:43:30)",
" at Module._compile (internal/modules/cjs/loader.js:999:30)",
" at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)",
" at Module.load (internal/modules/cjs/loader.js:863:32)",
" at Function.Module._load (internal/modules/cjs/loader.js:708:14)",
" at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)",
" at internal/main/run_main_module.js:17:47"
]
}

Another thing is that i had to change the command:

webpack -p --env production --mode production

inside client/package.json to

webpack -p --mode production

because the command npm run-script client:build does not work in my case otherwhise.

can you please re-try now

I know its quite late. The problem was that the node-serialize was not included in the ORDER-MANGER package.
I've updated the version. you can take a look now.