PyNose icon indicating copy to clipboard operation
PyNose copied to clipboard

runner.py error: "No such file or directory: PosixPath('gradlew')"

Open danieldavidf opened this issue 3 years ago • 16 comments

I followed the whole readme guide, but in the last step, when I ran the runner.py script, I got the following error:

image

danieldavidf avatar Sep 14 '21 16:09 danieldavidf

Hey, thanks for opening this issue!

Have you set the PLUGIN_ROOT parameter properly? It is on line 8, runner.py

SmirnovOleg avatar Sep 14 '21 20:09 SmirnovOleg

I believe so. I put the current directory, as specified (the folder that contains README.md (this file), runner.py, and build.gradle).

image

Is that correct?

danieldavidf avatar Sep 14 '21 23:09 danieldavidf

Could you try using absolute path for those variables?

WANGJIEKE avatar Sep 15 '21 00:09 WANGJIEKE

Yeah, runner.py ran up to 100% using absolute path, but I found no JSON file generated after its run. In the path specified in DETECTOR_OUTPUT only one file was generated: log.txt and in this file there is no information about the project to be analyzed.

I tried running get_csv_stats.py, but it didn't work. I believe this is because the JSON file was not generated:

image

danieldavidf avatar Sep 15 '21 10:09 danieldavidf

Could you post the content of log.txt here?

WANGJIEKE avatar Sep 17 '21 16:09 WANGJIEKE

project=PosixPath('/home/daniel/Documents/geokey/.git') ====STDOUT====

Task :compileJava UP-TO-DATE Task :patchPluginXml UP-TO-DATE Task :processResources UP-TO-DATE Task :classes UP-TO-DATE Task :instrumentCode UP-TO-DATE Task :postInstrumentCode Task :jar UP-TO-DATE Task :prepareSandbox UP-TO-DATE

Task :runIde Already running

BUILD SUCCESSFUL in 2s 8 actionable tasks: 2 executed, 6 up-to-date

====STDERR====WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by com.intellij.util.ui.StartupUiUtil to constructor com.sun.java.swing.plaf.gtk.GTKLookAndFeel() WARNING: Please consider reporting this to the maintainers of com.intellij.util.ui.StartupUiUtil WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release

project=PosixPath('/home/daniel/Documents/geokey/local_settings.example') ====STDOUT====

Task :compileJava UP-TO-DATE Task :patchPluginXml UP-TO-DATE Task :processResources UP-TO-DATE Task :classes UP-TO-DATE Task :instrumentCode UP-TO-DATE Task :postInstrumentCode Task :jar UP-TO-DATE Task :prepareSandbox UP-TO-DATE

Task :runIde Already running

BUILD SUCCESSFUL in 2s 8 actionable tasks: 2 executed, 6 up-to-date

====STDERR====WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by com.intellij.util.ui.StartupUiUtil to constructor com.sun.java.swing.plaf.gtk.GTKLookAndFeel() WARNING: Please consider reporting this to the maintainers of com.intellij.util.ui.StartupUiUtil WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release

project=PosixPath('/home/daniel/Documents/geokey/db') ====STDOUT====

Task :compileJava UP-TO-DATE Task :patchPluginXml UP-TO-DATE Task :processResources UP-TO-DATE Task :classes UP-TO-DATE Task :instrumentCode UP-TO-DATE Task :postInstrumentCode Task :jar UP-TO-DATE Task :prepareSandbox UP-TO-DATE

Task :runIde Already running

BUILD SUCCESSFUL in 1s 8 actionable tasks: 2 executed, 6 up-to-date

====STDERR====WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by com.intellij.util.ui.StartupUiUtil to constructor com.sun.java.swing.plaf.gtk.GTKLookAndFeel() WARNING: Please consider reporting this to the maintainers of com.intellij.util.ui.StartupUiUtil WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release

project=PosixPath('/home/daniel/Documents/geokey/geokey') ====STDOUT====

Task :compileJava UP-TO-DATE Task :patchPluginXml UP-TO-DATE Task :processResources UP-TO-DATE Task :classes UP-TO-DATE Task :instrumentCode UP-TO-DATE Task :postInstrumentCode Task :jar UP-TO-DATE Task :prepareSandbox UP-TO-DATE

Task :runIde Already running

BUILD SUCCESSFUL in 1s 8 actionable tasks: 2 executed, 6 up-to-date

====STDERR====WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by com.intellij.util.ui.StartupUiUtil to constructor com.sun.java.swing.plaf.gtk.GTKLookAndFeel() WARNING: Please consider reporting this to the maintainers of com.intellij.util.ui.StartupUiUtil WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release

danieldavidf avatar Sep 18 '21 11:09 danieldavidf

Hi I have the same problem here, only log.txt is generated.

freddiewanah avatar Sep 21 '21 17:09 freddiewanah

Is PyCharm running when you start the runner.py script? If so, please quit PyCharm completely before starting the runner.py.

The screenshot is a comparison between your log.txt (left side) and mine (right side). Looks like you already have PyCharm running and the plugin isn't starting (it didn't print args, paths, etc.).

Snipaste_2021-09-21_11-05-32

WANGJIEKE avatar Sep 21 '21 18:09 WANGJIEKE

When I close PyCharm and run runner.py, it does not process beyond 0%:

image

In this run, PyCharm opened, but nothing happens. The log.txt file was generated with no content. I waited for more than 15 minutes and the percentage remained at 0%.

danieldavidf avatar Sep 22 '21 11:09 danieldavidf

Do you mean there is a PyCharm window showing up when running the runner.py? If so, could you please check if the lines 27-37 in the build.gradle and line 17 in the plugin.xml are uncommented? They should be uncommented after setting up the Python interpreter; otherwise the plugin won't start.

Make sure the build.gradle and plugin.xml look like this when running the runner.py.

image

I just set up a Ubuntu 20.04 virtual machine and I didn't encounter any issue when running the tool

WANGJIEKE avatar Sep 24 '21 08:09 WANGJIEKE

Thanks for your attention. When I uncommented lines 27-37 in the build.gradle and line 17 in the plugin.xml, the runner.py ran up to 100%.

image

However, I could not find any generated JSON file. Here is the complete content of the newly generated log.txt:

project=PosixPath('/home/daniel/Documents/geokey/.git') ====STDOUT====

Task :compileJava UP-TO-DATE Task :patchPluginXml Task :processResources Task :classes Task :instrumentCode Task :postInstrumentCode Task :jar Task :prepareSandbox

Task :runIde args = [pynose, /home/daniel/Documents/geokey/.git, /usr/bin/python3.8, /home/daniel/Documents/PyNose/output] path = /home/daniel/Documents/geokey/.git outputDir = /home/daniel/Documents/PyNose/output outputFileName = /home/daniel/Documents/PyNose/output/.git.json Cannot find specified Python interpreter; printing available ones... pythonCandidate = Python 3.8: Python 3.8.10 (/usr/bin/python3.8) If nothing printed, you may have to go to GUI mode to configure a Python interpreter

BUILD SUCCESSFUL in 10s 8 actionable tasks: 7 executed, 1 up-to-date

====STDERR====WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by com.intellij.util.ui.StartupUiUtil to constructor com.sun.java.swing.plaf.gtk.GTKLookAndFeel() WARNING: Please consider reporting this to the maintainers of com.intellij.util.ui.StartupUiUtil WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release 2021-09-24 09:46:18,484 [ 563] WARN - llij.ide.plugins.PluginManager - Resource bundle redefinition for plugin 'com.jetbrains.pycharm.community.customization'. Old value: messages.ActionsBundle, new value: messages.PyBundle 2021-09-24 09:46:19,911 [ 1990] WARN - j.internal.DebugAttachDetector - Unable to start DebugAttachDetector, please add --add-exports java.base/jdk.internal.vm=ALL-UNNAMED to VM options

project=PosixPath('/home/daniel/Documents/geokey/local_settings.example') ====STDOUT====

Task :compileJava UP-TO-DATE Task :patchPluginXml UP-TO-DATE Task :processResources UP-TO-DATE Task :classes UP-TO-DATE Task :instrumentCode UP-TO-DATE Task :postInstrumentCode Task :jar UP-TO-DATE Task :prepareSandbox UP-TO-DATE

Task :runIde args = [pynose, /home/daniel/Documents/geokey/local_settings.example, /usr/bin/python3.8, /home/daniel/Documents/PyNose/output] path = /home/daniel/Documents/geokey/local_settings.example outputDir = /home/daniel/Documents/PyNose/output outputFileName = /home/daniel/Documents/PyNose/output/local_settings.example.json Cannot find specified Python interpreter; printing available ones... pythonCandidate = Python 3.8: Python 3.8.10 (/usr/bin/python3.8) If nothing printed, you may have to go to GUI mode to configure a Python interpreter

BUILD SUCCESSFUL in 8s 8 actionable tasks: 2 executed, 6 up-to-date

====STDERR====WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by com.intellij.util.ui.StartupUiUtil to constructor com.sun.java.swing.plaf.gtk.GTKLookAndFeel() WARNING: Please consider reporting this to the maintainers of com.intellij.util.ui.StartupUiUtil WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release 2021-09-24 09:46:27,184 [ 612] WARN - llij.ide.plugins.PluginManager - Resource bundle redefinition for plugin 'com.jetbrains.pycharm.community.customization'. Old value: messages.ActionsBundle, new value: messages.PyBundle 2021-09-24 09:46:28,705 [ 2133] WARN - j.internal.DebugAttachDetector - Unable to start DebugAttachDetector, please add --add-exports java.base/jdk.internal.vm=ALL-UNNAMED to VM options

project=PosixPath('/home/daniel/Documents/geokey/db') ====STDOUT====

Task :compileJava UP-TO-DATE Task :patchPluginXml UP-TO-DATE Task :processResources UP-TO-DATE Task :classes UP-TO-DATE Task :instrumentCode UP-TO-DATE Task :postInstrumentCode Task :jar UP-TO-DATE Task :prepareSandbox UP-TO-DATE

Task :runIde args = [pynose, /home/daniel/Documents/geokey/db, /usr/bin/python3.8, /home/daniel/Documents/PyNose/output] path = /home/daniel/Documents/geokey/db outputDir = /home/daniel/Documents/PyNose/output outputFileName = /home/daniel/Documents/PyNose/output/db.json Cannot find specified Python interpreter; printing available ones... pythonCandidate = Python 3.8: Python 3.8.10 (/usr/bin/python3.8) If nothing printed, you may have to go to GUI mode to configure a Python interpreter

BUILD SUCCESSFUL in 7s 8 actionable tasks: 2 executed, 6 up-to-date

====STDERR====WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by com.intellij.util.ui.StartupUiUtil to constructor com.sun.java.swing.plaf.gtk.GTKLookAndFeel() WARNING: Please consider reporting this to the maintainers of com.intellij.util.ui.StartupUiUtil WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release 2021-09-24 09:46:35,630 [ 574] WARN - llij.ide.plugins.PluginManager - Resource bundle redefinition for plugin 'com.jetbrains.pycharm.community.customization'. Old value: messages.ActionsBundle, new value: messages.PyBundle 2021-09-24 09:46:37,023 [ 1967] WARN - j.internal.DebugAttachDetector - Unable to start DebugAttachDetector, please add --add-exports java.base/jdk.internal.vm=ALL-UNNAMED to VM options

project=PosixPath('/home/daniel/Documents/geokey/geokey') ====STDOUT====

Task :compileJava UP-TO-DATE Task :patchPluginXml UP-TO-DATE Task :processResources UP-TO-DATE Task :classes UP-TO-DATE Task :instrumentCode UP-TO-DATE Task :postInstrumentCode Task :jar UP-TO-DATE Task :prepareSandbox UP-TO-DATE

Task :runIde args = [pynose, /home/daniel/Documents/geokey/geokey, /usr/bin/python3.8, /home/daniel/Documents/PyNose/output] path = /home/daniel/Documents/geokey/geokey outputDir = /home/daniel/Documents/PyNose/output outputFileName = /home/daniel/Documents/PyNose/output/geokey.json Cannot find specified Python interpreter; printing available ones... pythonCandidate = Python 3.8: Python 3.8.10 (/usr/bin/python3.8) If nothing printed, you may have to go to GUI mode to configure a Python interpreter

BUILD SUCCESSFUL in 13s 8 actionable tasks: 2 executed, 6 up-to-date

====STDERR====WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by com.intellij.util.ui.StartupUiUtil to constructor com.sun.java.swing.plaf.gtk.GTKLookAndFeel() WARNING: Please consider reporting this to the maintainers of com.intellij.util.ui.StartupUiUtil WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release 2021-09-24 09:46:43,497 [ 600] WARN - llij.ide.plugins.PluginManager - Resource bundle redefinition for plugin 'com.jetbrains.pycharm.community.customization'. Old value: messages.ActionsBundle, new value: messages.PyBundle 2021-09-24 09:46:44,925 [ 2028] WARN - j.internal.DebugAttachDetector - Unable to start DebugAttachDetector, please add --add-exports java.base/jdk.internal.vm=ALL-UNNAMED to VM options

danieldavidf avatar Sep 24 '21 13:09 danieldavidf

Sorry for late reply. The log file says the tool cannot find the specified Python interpreter.

image

Please go to runner.py and see if the PYTHON_INTERPRETER_NAME is correctly configured.

WANGJIEKE avatar Oct 04 '21 00:10 WANGJIEKE

I also push a new branch. You may try to run the plugin in that branch. The new branch called "new-sdk-setup" and it improves how Python interpreter get set up and also will print more log for debug.

WANGJIEKE avatar Oct 04 '21 00:10 WANGJIEKE

By the way, any progress on this? @danieldavidf have you obtained any JSON?

SmirnovOleg avatar Nov 09 '21 08:11 SmirnovOleg

I'm sorry, @SmirnovOleg , I didn't go on. I have been busy the last few days.

Could someone please walk me through the process of running PyNose? I can share my screen with you on a call and you can guide me. Is that ok?

danieldavidf avatar Nov 16 '21 11:11 danieldavidf

@danieldavidf Yeah, sorry, we have also been pre-ocupied with some stuff! Please note that the version of tool from the paper is now located in the ASE2021 branch, we have significantly revamped the master, now it is more focused on work in the IDE. If you still need the help, I would be happy to get onto a call and help you!

areyde avatar Dec 13 '21 09:12 areyde