Closed giimlhd closed 1 year ago
the version of codeql-cli is 2.11.3
Hmm, haven't seen that one before. I'd recommend the following troubleshooting steps:
codeql version --format json
to verify that the unpackedLocation
is what you expect it to be.[unpackedLocation]/tools/linux64/java/lib/jspawnhelper
exists and has execute permissions.$CODEQL_JAVA_HOME
set.-j-Djdk.lang.Process.launchMechanism=vfork
help (or produce a different error)?By the way, which Linux distribution are you running, and can you find out which version of glibc?
@hmakholm Thank you for your suggestions.
The Linux distribution is :
Linux version 3.10.0-862.el7.x86_64 (mockbuild@x86-034.build.eng.bos.redhat.com) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-28) (GCC) )
;
the glibc : glibc-2.17-222.el7
The problem still happen with the latest released CodeQL version (2.11.5) and the unpackedLocation is also what I expect it to be.
In fact, I have to run codeql-cli under a non root account, and have improved execute permissions of some files running chmod -R 777 codeql[ java、jspawnhelper ]
in these directories one by one: [unpackedLocation]/codeql
、[unpackedLocation]/tools/linux64/java/bin/java
、[unpackedLocation]/tools/linux64/java/lib/jspawnhelper
, and then , the IOException error mentioned above doesn't occurs, but another different error occurs instead when I run the command to create a database .
The command is the same as before:
codeql database create /home/abs4x/code-ql-test/test-db --overwrite --language=javascript --source-root=/home/abs4x/code-ql-test/QlComponent/
The error is :
Initializing database at /home/abs4x/code-ql-test/test-db.
Running build command: []
Finalizing database at /home/abs4x/code-ql-test/test-db.
No source code was seen and extracted to /home/abs4x/code-ql-test/test-db.
This can occur if the specified build commands failed to compile or process any code.
- Confirm that there is some source code for the specified language in the project.
- For codebases written in Go, JavaScript, TypeScript, and Python, do not specify
an explicit --command.
- For other languages, the --command must specify a "clean" build which compiles
all the source code files without reusing existing build artefacts.
How to solve this error ?
Can't the codeql-cli run under a non root account ?
CodeQL definitely doesn't require root -- I don't think we ever run or test it with root privileges ourselves.
It sounds like something is going wrong when you're unzipping the CLI download. On my Ubuntu 22.04 machine, all of the executables you mention unzip with permissions -rwxr-xr-x
for me. Perhaps you were running the unzipper with a restrictive umask
in effect? Or, if you let a web browser do the unzipping for you, it might have tampered with the permissions in the name of security.
The No source code was seen and extracted
error appears to be fallout from a similar permission problems with another internal CodeQL script -- I can reproduce your symptom by removing the execute permission from codeql/javascript/tools/autobuild.sh
after unzipping. (We seem to lack error checking for that case; I'll file an internal issue).
Thus the cure for that would be to make sure you're unzipping CodeQL with the correct permissions to begin with -- playing whack-a-mole with individual components doesn't feel promising.
Thank you for your reminder very much !
These permission problems did occur if I unzip the Cli download in a window system and then recompress to get a new zip file which will be uploaded to my linux server.(I admit my operations are a little silly).
Now I know the correct way is to upload the released Cli download without any operations from a window system to a linux one and it works.
good !
When I execute the command of creating a database on LinuxX64 , an error about IOException occurred.
the command is :
the tip about error is:
the log is :
I do not know how to solve this problem.