Why do I get an end of file error message when trying to use the MPS RESTful API?

조회 수: 3 (최근 30일)
We are trying to use the MATLAB Production Server (MPS) RESTful API from a Javascript webpage, but we get the below error in the browser:
Error:End of file (request id=0:5:1)
The MPS log shows:
1566 [2016.04.06 14:02:20.545294] [err] [worker:56] parse failed (worker=56, work_id=0:5:1)
1567 [2016.04.06 14:02:20.545294] [err] [worker:56] Error while processing requests:
1568 [2016.04.06 14:02:20.545294] [err] [worker:56] b:\matlab\deployment_server\worker\worker\src\mcrworker.cpp(259): Throw in function void __cdecl mds::worker::MCRWorker::do_work(const class mds::worker_protocol::StartWorkRequest &,class mds::util::protobuf::io::InterruptibleInputStream &,const class boost::function<void __cdecl(unsigned __int64,class mds::worker_protocol::maybe<class boost::function<void __cdecl(class google::protobuf::io::ZeroCopyOutputStream *)> > const &)> &)
1569 [2016.04.06 14:02:20.545294] [err] [worker:56] Dynamic exception type: class boost::exception_detail::clone_impl<struct boost::exception_detail::error_info_injector<class std::runtime_error> >
1570 [2016.04.06 14:02:20.545294] [error] generating error response (code = 500, message = 'End of file', request = 0:5:1)
1571 [2016.04.06 14:02:20.545294] [err] [worker:56] std::exception::what: params parse failed
1572 [2016.04.06 14:02:20.545294] [err] [worker:56]
1573 [2016.04.06 14:02:22.232942] [err] [worker:56] Uncaught exception:
1574 [2016.04.06 14:02:22.232942] [err] [worker:56] b:\matlab\deployment_server\worker\worker\src\mcrworker.cpp(259): Throw in function void __cdecl mds::worker::MCRWorker::do_work(const class mds::worker_protocol::StartWorkRequest &,class mds::util::protobuf::io::InterruptibleInputStream &,const class boost::function<void __cdecl(unsigned __int64,class mds::worker_protocol::maybe<class boost::function<void __cdecl(class google::protobuf::io::ZeroCopyOutputStream *)> > const &)> &)
1575 [2016.04.06 14:02:22.232942] [err] [worker:56] Dynamic exception type: class boost::exception_detail::clone_impl<struct boost::exception_detail::error_info_injector<class std::runtime_error> >
1576 [2016.04.06 14:02:22.232942] [err] [worker:56] std::exception::what: params parse failed
1577 [2016.04.06 14:02:22.232942] [err] [worker:56]
1578 [2016.04.06 14:02:22.232942] [err] [worker:56] (exiting)
1579 [2016.04.06 14:02:22.279805] [information] [SERVICE:worker] Worker 56 exited unexpectedly with code 4
1580 [2016.04.06 14:02:22.279805] [information] [SERVICE:worker] Restarting worker 56
 

채택된 답변

MathWorks Support Team
MathWorks Support Team 2016년 4월 6일
This parse error can occur because the MPS worker is trying to interpret the request as protobuf instead of JSON.  This can happen if either the request Content-Type is not being set or the MATLAB runtime running under the MPS worker is older than R2016a.  Make sure to set the request Content-Type to "application/json", and to use MATLAB runtime R2016a or later.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 RESTful API에 대해 자세히 알아보기

제품


릴리스

R2016a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by