Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Model Editor in Infinite Loading State with no error message #3642

Open
knewbury01 opened this issue Jun 17, 2024 · 1 comment
Open

Model Editor in Infinite Loading State with no error message #3642

knewbury01 opened this issue Jun 17, 2024 · 1 comment
Labels
bug Something isn't working VSCode

Comments

@knewbury01
Copy link

Describe the bug
Under some specific circumstance(s) the model editor gets into an infinite loading state, with no error message about what has gone wrong.

Version
The CodeQL and VS Code version in which the bug occurs.

VSCode CodeQL Extension version - v1.13.1
CodeQL CLI versions tested with: 2.16.3, 2.17.1, 2.17.4, 2.17.5

To reproduce
There are 2 scenarios where I have observed this. In scenario 1 , I admit that I am aware of the fact that the database has a missing file, and then perhaps this behaviour makes sense? (though I still think it would be hard to debug without an error message). In scenario 2, I do not know what the underlying issue is.

Both scenarios use the sample Java app in this repo

Scenario 1)

  1. perform:
javac SampleInner.java
codeql database create -l java databasenoinnerpresent --command='javac Sample.java'

successfully creates a database with no SampleInner.java file (probably this causes the silent error?)

  1. load the database into the editor
  2. open the model editor

end of CodeQL Query Server log shows:

[2024-06-17 16:31:43] (1s) Unpausing evaluation
[2024-06-17 16:31:43] Evaluation of /Users/knewbury/.codeql/packages/codeql/java-queries/1.0.1/utils/modeleditor/ApplicationModeEndpoints.ql produced BQRS results.

CodeQL Extension log tail:

CLI command succeeded.
Reading bqrs data using CodeQL CLI: bqrs decode -v --log-to-stderr --format json --entities=url,string --result-set #select /var/folders/2k/tdmj1d890_30b043s71nvt300000gn/T/queries_-16970-NvOnULt5vTtW/model-editor-results/ApplicationModeEndpoints.ql-48t4dwCRwNoDw-qj70hyb/results.bqrs...

CLI command succeeded.

Scenario 2)

  1. perform:
javac SampleInner.java
codeql database create -l java databaseinnerpresent --command='javac -cp . Sample.java'

successfully creates a database with both, as expected, Sample.java and SampleInner.java file

  1. load the database into the editor
  2. open the model editor
  3. select "Model as Dependency"

end of CodeQL Query Server log shows:

[2024-06-17 16:16:50] (0s) Unpausing evaluation
[2024-06-17 16:16:50] Evaluation of /Users/knewbury/.codeql/packages/codeql/java-queries/1.0.1/utils/modeleditor/FrameworkModeEndpoints.ql produced BQRS results.

CodeQL Extension log tail:

CLI command succeeded.
Reading bqrs data using CodeQL CLI: bqrs decode -v --log-to-stderr --format json --entities=url,string --result-set #select /var/folders/2k/tdmj1d890_30b043s71nvt300000gn/T/queries_-16970-NvOnULt5vTtW/model-editor-results/FrameworkModeEndpoints.ql-IAvaxSoFVfUsZFMsOlDMj/results.bqrs...

CLI command succeeded.

both yield a infinite Modelling Java panel like:

Image

Expected behavior
I expect a failure message to display so that the reasons for the hang can be fixed (ie if there is something wrong with a database then how would a user know that unless there is some error message). I am not currently sure why I cannot model the database in the example as a dependency...

Additional context
Add any other context about the problem here.

@knewbury01 knewbury01 added the bug Something isn't working label Jun 17, 2024
@atorralba
Copy link

Something similar is happening to me, the extension logs only say:

Failed to load results: Internal error.
Error: Internal error.
    at handleResponse (/Users/tony/.vscode/extensions/github.vscode-codeql-1.13.1/out/extension.js:36803:40)
    at handleMessage (/Users/tony/.vscode/extensions/github.vscode-codeql-1.13.1/out/extension.js:36613:11)
    at processMessageQueue (/Users/tony/.vscode/extensions/github.vscode-codeql-1.13.1/out/extension.js:36628:13)
    at Immediate.<anonymous> (/Users/tony/.vscode/extensions/github.vscode-codeql-1.13.1/out/extension.js:36604:11)
    at processImmediate (node:internal/timers:478:21)

Versions:

CodeQL extension version: 1.13.1 
CodeQL CLI version: 2.17.5 
Platform: darwin x64
VSCode Version: 1.90.1 (Universal)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working VSCode
Projects
None yet
Development

No branches or pull requests

2 participants