Why the Initializing linter did not proceed in docker container?

If your question is about SonarLint in the IntelliJ Platform, VS Code, Visual Studio, or Eclipse, please post it in that sub-category.

Otherwise, please provide:

  • Operating system: Linux 3.10.0-693.2.2.el7.x86_64 amd64
  • IDE name and flavor/env:
    SonarQube server 9.9.4.87374
    SonarScanner 5.0.1.3006
    Java 17.0.8 Alpine (64-bit)
    Node.js v18.17.1

And a thorough description of the problem / question:
after staring eslint-bridge server and Using generated tsconfig.json file and 1 source file to be analyzed, no any progress, util the timeout setting ( default: 1h)

  1. this issue occurred in docker container.
  2. in local env, using sonar-scanner command, it’s OK.

if it’s ok, the next line of logs should be
DEBUG: Initializing linter “default” with no-vue-bypass-sanitization,hash…

but it is not be displayed.
it seem it did not step into the “Initialize Linter”
and the “analyzeProject” will invoking the method: initializeLinter.
and the thread worker message listener, on “on-analyze-project”, will invoking the “analyzeProject”,

and router.post(‘/analyze-project’, delegate(worker, ‘on-analyze-project’)) take care of the on-analyze-project,

**so it’s caused by this ? **
and how to check this worker/message and verify?
and why it works in local env?
thanks very much

I had raise sonar.javascript.node.maxspace to 8192, even 16396, it not works.
should I raise the memory/share_memory for the docker container? thanks.

export function initializeLinter(
  inputRules: RuleConfig[],
  environments: string[] = [],
  globals: string[] = [],
  linterId = 'default',
) {
  debug(`Initializing linter "${linterId}" with ${inputRules.map(rule => rule.key)}`);
  linters[linterId] = new LinterWrapper({ inputRules, environments, globals });
}
04:36:03.557 DEBUG: Starting server
04:36:03.561 DEBUG: Using default Node.js executable: 'node'.
04:36:03.561 DEBUG: Checking Node.js version
04:36:03.562 DEBUG: Launching command node -v
04:36:03.586 DEBUG: Using Node.js v18.17.1.
04:36:03.586 DEBUG: Starting Node.js process to start eslint-bridge server at port 34262
04:36:03.586 DEBUG: Launching command node --max-old-space-size=10240 /builds/4bhyV3bz/1/tngd-mobile/tngd-web/transactions/.scannerwork/.sonartmp/eslint-bridge-bundle/package/bin/server 34262 127.0.0.1 /builds/4bhyV3bz/1/tngd-mobile/tngd-web/transactions/.scannerwork true false /builds/4bhyV3bz/1/tngd-mobile/tngd-web/transactions/.scannerwork/.sonartmp/eslint-bridge-bundle/package/custom-rules7545964472552891917/package
04:36:07.030 DEBUG: starting eslint-bridge server at port 34262
04:36:07.053 DEBUG: eslint-bridge server is running at port 34262
04:36:07.110 DEBUG: Starting server (done) | time=3553ms
04:36:07.130 DEBUG: Using generated tsconfig.json file /builds/4bhyV3bz/1/tngd-mobile/tngd-web/transactions/.scannerwork/.sonartmp/4776692619419491288.tmp
04:36:07.137 DEBUG: Analysis of unchanged files will not be skipped (current analysis requires all files to be analyzed)
04:36:07.138 INFO: 1 source file to be analyzed
ERROR: Job failed: execution took longer than 1h0m0s seconds
export function initializeLinter(
  inputRules: RuleConfig[],
  environments: string[] = [],
  globals: string[] = [],
  linterId = 'default',
) {
  debug(`Initializing linter "${linterId}" with ${inputRules.map(rule => rule.key)}`);
  linters[linterId] = new LinterWrapper({ inputRules, environments, globals });
}

export async function analyzeProject(input: ProjectAnalysisInput): Promise<ProjectAnalysisOutput> {
  ...
  const watchProgram = input.isSonarlint;
  initializeLinter(rules, environments, globals);
....



 case 'on-analyze-project': {
          const output = await analyzeProject(data);
          parentThread.postMessage({ type: 'success', result: JSON.stringify(output) });
          break;
        }

  /** Endpoints running on the worker thread */
  router.post('/analyze-project', delegate(worker, 'on-analyze-project'));

Hi,

Are you using the Sonar-distributed SonarScanner CLI Docker image or your own?

Can you provide the rest of the log?

 
Ann

very thanks in advance.

we purchase the sonarqube, and run in the gitlab runner, it’s not good now.
the sonarqube website can received and scan/output the right result, but the gitlab runner won’t display the logs after “eslint-bridge-server is starting”, util timeout.

below is the logs in runner:

and if we run the command in local macbook, “sonar-scanner -Dsonar.host.url=…”, it works.

Hi,

That sounds like a problem with your Docker image. Again,

 
Ann