ControlCore-Project / concore

Framework for Closed-Loop peripheral neuromodulation control systems
https://control-core.readthedocs.io
GNU Lesser General Public License v2.1
9 stars 20 forks source link

concore FRI methods (build, debug, run, clear, stop, and destroy) do not work in Windows #31

Closed parteekcoder closed 1 year ago

parteekcoder commented 1 year ago

I am trying to make request on all routes to understand the concore better "upload" route is working fine But when I ran "build" it didn't work

It showed me "FileNotFoundError" see last line

image

@pradeeban

parteekcoder commented 1 year ago

Hey @pradeeban This is a bug.

I am running this on windows

I am making changes to this PR when it is completed I will tell you

pradeeban commented 1 year ago

Can you please re-run on the main branch and copy-paste the whole error (instead of a screenshot)?

@amit-62 implemented this and tested it on Linux and Mac. It was not tested on Windows, and likely, something is missing. Any possible fixes should be tested on both Linux and Windows to avoid breaking the Linux version.

parteekcoder commented 1 year ago

Can you please re-run on the main branch and copy-paste the whole error (instead of a screenshot)?

@amit-62 implemented this and tested it on Linux and Mac. It was not tested on Windows, and likely, something is missing. Any possible fixes should be tested on both Linux and Windows to avoid breaking the Linux version.

I have tested my changes on windows and MACOS but I will update all paths shortly

pradeeban commented 1 year ago

Thanks a lot, @parteekcoder!

parteekcoder commented 1 year ago

Can you please re-run on the main branch and copy-paste the whole error (instead of a screenshot)?

@amit-62 implemented this and tested it on Linux and Mac. It was not tested on Windows, and likely, something is missing. Any possible fixes should be tested on both Linux and Windows to avoid breaking the Linux version.

yes sure this is the error

Traceback (most recent call last): File "C:\Users\Nitika\AppData\Local\Programs\Python\Python310\lib\site-packages\flask\app.py", line 2070, in wsgi_app response = self.full_dispatch_request() File "C:\Users\Nitika\AppData\Local\Programs\Python\Python310\lib\site-packages\flask\app.py in _execute_child hp, ht, pid, tid = _winapi.CreateProcess(executable, args, FileNotFoundError: [WinError 2] The system cannot find the file specified127.0.0.1 - - [19/Feb/2023 01:34:44] "POST /build/test?fetch=sampleplot&apikey=xyz HTTP/1.1" 500 - [2023-02-19 01:34:59,867] ERROR in app: Exception on /build/test [POST] Traceback (most recent call last): File "C:\Users\Nitika\AppData\Local\Programs\Python\Python310\lib\site-packages\flask\app.py", line 2070, in wsgi_app response = self.full_dispatch_request() File "C:\Users\Nitika\AppData\Local\Programs\Python\Python310\lib\site-packages\flask\app.py", line 1515, in full_dispatch_request rv = self.handle_user_exception(e) File "C:\Users\Nitika\AppData\Local\Programs\Python\Python310\lib\site-packages\flask_cors\extension.py", line 165, in wrapped_function return cors_after_request(app.make_response(f(args, kwargs))) File "C:\Users\Nitika\AppData\Local\Programs\Python\Python310\lib\site-packages\flask\app.py", line 1513, in full_dispatch_request rv = self.dispatch_request() File "C:\Users\Nitika\AppData\Local\Programs\Python\Python310\lib\site-packages\flask\app.py", line 1499, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(req.view_args) File "F:\GSOC\emori-bmi-gsoc\concore\concore\fri\server\main.py", line 73, in build proc = call(["./makestudy", makestudy_dir], cwd=concore_path) File "C:\Users\Nitika\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 345, in call with Popen(popenargs, **kwargs) as p: File "C:\Users\Nitika\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 969, in init self._execute_child(args, executable, preexec_fn, close_fds, File "C:\Users\Nitika\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 1438, in _execute_child hp, ht, pid, tid = _winapi.CreateProcess(executable, args, FileNotFoundError: [WinError 2] The system cannot find the file specified

pradeeban commented 1 year ago

Fixed in #51.

amit-62 commented 1 year ago

Hello everyone sorry for chiming in late but putting shell=true in subprocess exposes it to security leaks. @parteekcoder please look into this.

pradeeban commented 1 year ago

@Rahuljagwani implemented the PR. I think at this point, when we are not really using it in practice, it is better to have an implementation that works for Windows (as in the merged PR). In the next iteration, we can improve further (incorporating Kong and API keys).