Rest_translation_server returning 500 Internal Server Error


(Terence Lewis) #1

Hi, I have rest_translation_server running perfectly on my production server.
However, on my development machine rest_translation_server.lua has started to fail, returning the message "500 Internal Server Error - Error in application: …~/OpenNMT/tools/rest_translation_server.lua:127: attempt to index field ‘src’ (a nil value). I get this even when I do curl -v -H "Content-Type: application/json -X POST -d '[{“src”: “internationale migratie”}]
Does anyone who had a hand in writing rest_translation_server have any idea what might be happening. As I said, I have this server running perfectly on another machine.
I am using v05.

(Vincent Nguyen) #2

you need to update to git master and also luarocks install nn

(Terence Lewis) #3

nn failed to build. Would I need to update Torch?

(Guillaume Klein) #4

rest_translation_server.lua@v0.5 did not support batch translation. So the syntax is:

curl -v -H "Content-Type: application/json" -X POST -d '{"src": "internationale migratie"}'

(Terence Lewis) #5

OK, I have now installed v0.7.0 but it complains that module “nn” is not found and when I try to install that the build fails with Error 1 & Error 2. So, do I need to install the latest release of Torch?

(Terence Lewis) #6

The answer is “Yes”. Updated Torch and nn now builds - just in case anyone else has this issue.