Mountebank Proxies
Expected behaviour
mb restart --configfile mb.json above command should start mountebank stub using mb.json stub file. mb.json has created using live response from destination service using mountebank proxy. It will store a soap response, this response has a pdf file as well as attachment.
Actual behaviour
Getting below exception -
C:\Users<useraname>\AppData\Roaming\npm\node_modules\mountebank\node_modules\q\q.js:155 throw e; ^ Error: Could not find matching close tag for "<%". at C:\Users\useraname\AppData\Roaming\npm\node_modules\mountebank\node_modules\ejs\lib\ejs.js:738:19 at Array.forEach () at Template.generateSource (C:\Users\useraname\AppData\Roaming\npm\node_modules\mountebank\node_modules\ejs\lib\ejs.js:721:15) at Template.compile (C:\Users\useraname\AppData\Roaming\npm\node_modules\mountebank\node_modules\ejs\lib\ejs.js:574:12) at Object.compile (C:\Users\useraname\AppData\Roaming\npm\node_modules\mountebank\node_modules\ejs\lib\ejs.js:392:16) at handleCache (C:\Users\useraname\AppData\Roaming\npm\node_modules\mountebank\node_modules\ejs\lib\ejs.js:215:18) at Object.exports.render (C:\Users\useraname\AppData\Roaming\npm\node_modules\mountebank\node_modules\ejs\lib\ejs.js:419:10) at Object.load (C:\Users\useraname\AppData\Roaming\npm\node_modules\mountebank\node_modules\mountebank-formatters\src\default.js:42:67) at Object.load (C:\Users\useraname\AppData\Roaming\npm\node_modules\mountebank\node_modules\mountebank-formatters\src\index.js:13:43) at Object.loadConfig (C:\Users\useraname\AppData\Roaming\npm\node_modules\mountebank\src\cli\api.js:69:24)
Steps to reproduce
Installed mountebank in window 10 workstation Step 1 - Start mountebank using command mb in first gitbash Step 2 - create a proxy in using below script in second gitbash curl -i -X POST -H 'Content-Type: application/json' http://127.0.0.1:2525/imposters --data '{ "port":9901, "protocol":"http", "name":"proxyOnce", "recordRequests": true, "stubs":[ { "responses":[ { "proxy":{ "to":"https://XXXXXXX:1234", //hostname and port of target service "mode":"proxyOnce", "predicateGenerators":[ { "matches":{ "headers":true, "method":true, "path":true, "body":true}, "caseSensitive":true } ] } } ] } ] }' Step 3 - Configure proxy url instead of actual destination service URL and process few transactions to build a proxy cache. Step 4 - Save proxy stub file using below command mb save savefile --mb.json --removeProxies Step 5 - mb restart --configfile mb.json
Software versions used
OS : Window 10
mountebank : 2.4.0
node.js :
(only if installed via npm)
Installation method : tar
(npm, zip, tar, pkg, deb, rpm)
Log contents in mb.log when running mb --loglevel debug
Log contents here
hi, did you find a solution? I'm having the same problem at the moment
It appears to be an EJS parsing error. Can you share an example mb.json config file that triggers the error?