rage / tmc-vscode

TestMyCode extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=moocfi.test-my-code
MIT License
24 stars 6 forks source link

Empty Langs Response Error #693

Closed repenaattori closed 11 months ago

repenaattori commented 1 year ago

Describe the bug Getting Empty Langs Response Error when submitting exercise to the server or running test by TMC button.

To Reproduce Steps to reproduce the behavior:

  1. Go to your exercise file
  2. Click on run tests TMC button (or for some this error occurs when running submit exercise)
  3. Wait for the tests/submit to run and check the result window
  4. Shows the Empty Langs Response Error

Expected behavior Tests result view shows the passed/failed test results OR Submit result view shows that the exercise is successfully passed to the server

Screenshots image

Desktop (please complete the following information):

TMC Extension logs


[INFO] Testing exercise 
[2023-09-15 07:28:14:240] [INFO] Active text document language: java 
[2023-09-15 07:28:14:240] [INFO] Running "c:\Users\Myuser\AppData\Roaming\Code\User\globalStorage\moocfi.test-mycode\cli\tmc-langs-cli-x86_64-pc-windows-msvc-0.35.0.exe" "run-tests" "-- exercise-path" "c:\Users\Myuser\AppData\Local\tmc\vscode\oamk-javaoamk-english-2023\part03-Part03_05.LastInList" 
[2023-09-15 07:28:14:240] [DEBUG] Backend at https://tmc.mooc.fi 
[2023-09-15 07:28:14:372] [INFO] Running local tests for part03- Part03_05.LastInList 
[2023-09-15 07:28:14:885] [DEBUG] stderr [2023-09-15T07:28:14Z DEBUG tmc_langs] running tests in c:\Users\Myuser\AppData\Local\tmc\vscode\oamk-java-oamk-english-2023\part03- Part03_05.LastInList 
[2023-09-15 07:28:14:885] [INFO] Rust Langs [2023-09-15T07:28:14Z DEBUG tmc_langs] running tests in c:\Users\Myuser\AppData\Local\tmc\vscode\oamk-java-oamk-english-2023\part03- Part03_05.LastInList 
[2023-09-15 07:28:14:891] [DEBUG] stderr [2023-09-15T07:28:14Z INFO tmc_langs_plugins] Detected project at c:\Users\Myuser\AppData\Local\tmc\vscode\oamk-java-oamk-english-2023\part03- Part03_05.LastInList as apache-maven 
[2023-09-15 07:28:14:891] [INFO] Rust Langs [2023-09-15T07:28:14Z INFO tmc_langs_plugins] Detected project at c:\Users\Myuser\AppData\Local\tmc\vscode\oamk-java-oamk-english-2023\part03- Part03_05.LastInList as apache-maven 
[2023-09-15 07:28:14:908] [DEBUG] stderr [2023-09-15T07:28:14Z DEBUG tmc_langs_java] updating tmc junit runner jar 
[2023-09-15 07:28:14:908] [INFO] Rust Langs [2023-09-15T07:28:14Z DEBUG tmc_langs_java] updating tmc junit runner jar 
[2023-09-15 07:28:14:910] [DEBUG] stderr [2023-09-15T07:28:14Z DEBUG tmc_langs_java] junit runner at C:\Users\Myuser\AppData\Local\tmc\tmc-junit-runner.jar 
[2023-09-15 07:28:14:910] [INFO] Rust Langs [2023-09-15T07:28:14Z DEBUG tmc_langs_java] junit runner at C:\Users\Myuser\AppData\Local\tmc\tmc-junit-runner.jar 
[2023-09-15 07:28:14:963] [DEBUG] stderr [2023-09-15T07:28:14Z DEBUG tmc_langs_java] checkstyle runner at C:\Users\Myuser\AppData\Local\tmc\tmc-checkstyle-runner.jar 
[2023-09-15 07:28:14:963] [INFO] Rust Langs [2023-09-15T07:28:14Z DEBUG tmc_langs_java] checkstyle runner at C:\Users\Myuser\AppData\Local\tmc\tmc-checkstyle-runner.jar 
[2023-09-15 07:28:14:990] [DEBUG] stderr [2023-09-15T07:28:14Z DEBUG tmc_langs_java] initialized jassets at C:\Users\Myuser\AppData\Local\tmc\jassets\j4rs.jar 
[2023-09-15 07:28:14:990] [INFO] Rust Langs [2023-09-15T07:28:14Z DEBUG tmc_langs_java] initialized jassets at C:\Users\Myuser\AppData\Local\tmc\jassets\j4rs.jar 
[2023-09-15 07:28:14:992] [DEBUG] stderr [2023-09-15T07:28:14Z INFO j4rs::logger] Setting classpath to - Djava.class.path=C:\Users\Myuser\AppData\Local\tmc\jassets\j4rs.jar;C:\Users\Myuser\AppData\Local\tmc\tmc-junit-runner.jar;C:\Users\Myuser\AppData\Local\tmc\tmc-checkstyle-runner.jar [2023-09-15T07:28:14Z INFO j4rs::logger] Setting library path to - Djava.library.path=C:\Users\Myuser\AppData\Local\tmc\deps 
[2023-09-15 07:28:14:992] [INFO] Rust Langs [2023-09-15T07:28:14Z INFO j4rs::logger] Setting classpath to - Djava.class.path=C:\Users\Myuser\AppData\Local\tmc\jassets\j4rs.jar;C:\Users\Myuser\AppData\Local\tmc\tmc-junit-runner.jar;C:\Users\Myuser\AppData\Local\tmc\tmc-checkstyle-runner.jar [2023-09-15T07:28:14Z INFO j4rs::logger] Setting library path to - Djava.library.path=C:\Users\Myuser\AppData\Local\tmc\deps 
[2023-09-15 07:28:14:994] [DEBUG] stderr [2023-09-15T07:28:14Z DEBUG j4rs::logger] Creating a Jvm 
[2023-09-15 07:28:14:994] [INFO] Rust Langs [2023-09-15T07:28:14Z DEBUG j4rs::logger] Creating a Jvm 
[2023-09-15 07:28:15:341] [DEBUG] stderr [2023-09-15T07:28:15Z INFO j4rs::logger] No JVMs exist. Creating a new one... 
[2023-09-15 07:28:15:341] [INFO] Rust Langs [2023-09-15T07:28:15Z INFO j4rs::logger] No JVMs exist. Creating a new one... 
[2023-09-15 07:28:15:878] [WARN] Failed to parse TMC-langs output 
[2023-09-15 07:28:15:878] [DEBUG] Error occurred during initialization of VM 
[2023-09-15 07:28:15:878] [WARN] Failed to parse TMC-langs output 
[2023-09-15 07:28:15:878] [DEBUG] java.lang.Error: org.astonbitecode.j4rs.api.deploy.J4rsClassLoader 
[2023-09-15 07:28:15:878] [WARN] Failed to parse TMC-langs output 
[2023-09-15 07:28:15:878] [DEBUG] at java.lang.ClassLoader.initSystemClassLoader(java.base@19.0.2/ClassLoader.java:2010) 
[2023-09-15 07:28:15:878] [WARN] Failed to parse TMC-langs output 
[2023-09-15 07:28:15:878] [DEBUG] at java.lang.System.initPhase3(java.base@19.0.2/System.java:2310) 
[2023-09-15 07:28:15:878] [WARN] Failed to parse TMC-langs output 
[2023-09-15 07:28:15:879] [DEBUG] Caused by: java.lang.ClassNotFoundException: org.astonbitecode.j4rs.api.deploy.J4rsClassLoader 
[2023-09-15 07:28:15:879] [WARN] Failed to parse TMC-langs output 
[2023-09-15 07:28:15:879] [DEBUG] at jdk.internal.loader.BuiltinClassLoader.loadClass(java.base@19.0.2/BuiltinClassLoade r.java:641) 
[2023-09-15 07:28:15:879] [WARN] Failed to parse TMC-langs output 
[2023-09-15 07:28:15:879] [DEBUG] at jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(java.base@19.0.2/ClassLoa ders.java:188) 
[2023-09-15 07:28:15:879] [WARN] Failed to parse TMC-langs output 
[2023-09-15 07:28:15:879] [DEBUG] at java.lang.ClassLoader.loadClass(java.base@19.0.2/ClassLoader.java:521) 
[2023-09-15 07:28:15:885] [WARN] Failed to parse TMC-langs output 
[2023-09-15 07:28:15:885] [DEBUG] at java.lang.Class.forName0(java.base@19.0.2/Native Method) 
[2023-09-15 07:28:15:885] [WARN] Failed to parse TMC-langs output 
[2023-09-15 07:28:15:885] [DEBUG] at java.lang.Class.forName(java.base@19.0.2/Class.java:495) 
[2023-09-15 07:28:15:885] [WARN] Failed to parse TMC-langs output 
[2023-09-15 07:28:15:885] [DEBUG] at java.lang.Class.forName(java.base@19.0.2/Class.java:474) 
[2023-09-15 07:28:15:885] [WARN] Failed to parse TMC-langs output 
[2023-09-15 07:28:15:885] [DEBUG] at java.lang.ClassLoader.initSystemClassLoader(java.base@19.0.2/ClassLoader.java:1996) 
[2023-09-15 07:28:15:885] [WARN] Failed to parse TMC-langs output 
[2023-09-15 07:28:15:886] [DEBUG] at java.lang.System.initPhase3(java.base@19.0.2/System.java:2310) 
[2023-09-15 07:28:15:922] [ERROR] Exercise test run failed. Empy Langs Response Error — Langs process ended without result data. — Empy Langs Response Error: Langs process ended without result data. at l. (c:\Users\Myuser.vscode\extensions\moocfi.test-mycode-2.2.2\dist\lib.js:2:505888) at Generator.next () at o (c:\Users\Myuser.vscode\extensions\moocfi.test-my-code2.2.2\dist\lib.js:2:395257) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) 
[2023-09-15 07:28:18:764] [DEBUG] Text document languageId Log

Additional context The tests work by running them directly from VS Code tests tab. If the problem occurs during the submit, the exercises are sent to the server and points are submitted thus the error won't affect the actual submit result. The previous logs are from running the tests. No logs from the submit case.

muzaffarmhd commented 1 year ago

I am getting the same issue here after the new update, even if i install a previous version of the extension, it doesn't solve the problem

Heliozoa commented 1 year ago

From the logs it appears this is related to the Java setup: Caused by: java.lang.ClassNotFoundException: org.astonbitecode.j4rs.api.deploy.J4rsClassLoader. So far I have not been able to replicate this issue on my Windows 10 install, but you could try making sure that the JAVA_HOME environment variable is set up correctly and/or reinstalling Java while I look into this further.

You can check the JAVA_HOME environment variable by running echo %JAVA_HOME% in the terminal or finding the environment variables menu through the Control Panel. The variable should contain the path to an up to date Java install, such as C:\Program Files\Eclipse Adoptium\jdk-17.0.6.10-hotspot.

Both the automated tests and my local install use the latest LTS release of Eclipse Temurin OpenJDK 17 from https://adoptium.net/, so it should hopefully at least work with that.

repenaattori commented 1 year ago

I had a conversation with one of the students that earlier had this problem. We checked and the Environment variables are set correctly (I've guided this in the beginning of the course). I think no one got this error until updating from version 2.1.5.

I'm not sure if the students are willing to start to change their Java configurations this late in the course as the problem is not preventing the submission, but I could recommend to install the Temurin version in the next implementation.

5yn7hW4v3 commented 12 months ago

Getting it as well in GitHub Code Spaces

Empy Langs Response Error

Langs process ended without result data.

Details:

Error stack

Empy Langs Response Error: Langs process ended without result data. at l. (/home/codespace/.vscode-remote/extensions/moocfi.test-my-code-2.2.2/dist/lib.js:2:505888) at Generator.next () at o (/home/codespace/.vscode-remote/extensions/moocfi.test-my-code-2.2.2/dist/lib.js:2:395257) at processTicksAndRejections (node:internal/process/task_queues:95:5)

However, it runs the tests just fine. The above I only see when submit to server. When I go back to course and refresh the exercise I can see I have gotten the points.

AggroGoose commented 11 months ago

I'm receiving the error as well, but only on successful code submissions. When code is submitted, accepted into TMC and counted for points in the TMC server that's when I get the error. However if I submit code that is incorrect and 'pass fail' feedback is given explaining why the submissionf ailed, or if the code itself was broken because I included an extra parenthesis or bracket or forgot a semicolon I will get feedback from the submission as expected.

Currently running the Java Programming I course so I can't speak to whether the problem is happening on other courses, but I'm guessing there's either a server timeout ending the connection without a server response, a server response on successful submission isn't given at all, or the response from the server on successful submission is different from what the TMC plugin is expecting.

Note: I am also using the latest version of the TestMyCode plugin v2.2.2

Heliozoa commented 11 months ago

This should be fixed now in 2.2.3, thanks for the reports.

5yn7hW4v3 commented 11 months ago

This should be fixed now in 2.2.3, thanks for the reports.

@Heliozoa - Can confirm that version 2.2.3 has fixed the issue for me. Thanks so much for all the work you do on this extension. The community really appreciates it!