Why do I get an end of file error message when trying to use the MPS RESTful API?
    3 visualizzazioni (ultimi 30 giorni)
  
       Mostra commenti meno recenti
    
    MathWorks Support Team
    
 il 6 Apr 2016
  
    
    
    
    
    Risposto: MathWorks Support Team
    
 il 6 Apr 2016
            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
Risposta accettata
  MathWorks Support Team
    
 il 6 Apr 2016
        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 Commenti
Più risposte (0)
Vedere anche
Categorie
				Scopri di più su RESTful API in Help Center e File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!