forcedotcom / salesforcedx-vscode

Salesforce Extensions for VS Code
https://developer.salesforce.com/tools/vscode
BSD 3-Clause "New" or "Revised" License
944 stars 400 forks source link

Apex Language Server Fails to Start - Expected the service ApexIndexer [FAILED] to be RUNNING #5546

Closed gematria closed 2 months ago

gematria commented 2 months ago

Summary

Since I've upgraded to the latest version of VSC I'am constantly getting error on starting Apex Server

Steps To Reproduce:

  1. Start VSCode

Establish a connection with Apex Server

Actual result

Apex Server fails to start, VSCode became unusable, it freezes completely every 10 sec trying to restart the server

Additional information

11:14:58.125 [Apex Prelude Service STARTING] INFO a.j.l.i.s.ApexPreludeManagedService - Scanning built-in and system Apex types. 11:14:58.331 [Apex Prelude Service STARTING] INFO a.j.l.i.s.ApexPreludeManagedService - Scanning built-in Apex types. 11:14:58.344 [Apex Prelude Service STARTING] INFO a.j.l.i.s.ApexPreludeManagedService - Collecting built-in standard types from jar 11:15:03.125 [Apex Prelude Service STARTING] INFO a.j.l.i.s.ApexPreludeManagedService - Done collecting built-in standard types from jar 11:15:03.125 [Apex Prelude Service STARTING] INFO a.j.l.i.s.ApexPreludeManagedService - Scanning Apex Standard Library. 11:15:03.951 [Apex Prelude Service STARTING] INFO a.j.l.i.s.ApexPreludeManagedService - Done scanning Apex Standard Library. 11:15:03.951 [Apex Prelude Service STARTING] INFO a.j.l.i.s.ApexPreludeManagedService - Starting ApexIndexer. 11:15:03.971 [ApexIndexer STARTING] INFO a.jorje.lsp.impl.index.ApexIndexer - ApexIndexer: Start indexer. 11:15:03.981 [ApexIndexer STARTING] INFO a.jorje.lsp.impl.index.ApexIndexer - ApexIndexer: Scanning user-defined types. 11:15:03.981 [ApexIndexer STARTING] INFO a.jorje.lsp.impl.index.ApexIndexer - ApexIndexer: Scanning workspace source. 11:15:10.899 [ApexIndexer STARTING] INFO a.jorje.lsp.impl.index.ApexIndexer - ApexIndexer: Building change list. 11:15:13.035 [ApexIndexer STARTING] INFO a.jorje.lsp.impl.index.ApexIndexer - ApexIndexer: Applying found changes 11:15:13.036 [ApexIndexer STARTING] INFO a.jorje.lsp.impl.index.ApexIndexer - ApexIndexer: Creating 6071 Apex artifacts in Apex DB apr 22, 2024 11:15:16 AM apex.jorje.parser.impl.BaseApexLexer dedupe INFO: Deduped array ApexLexer.DFA22_transition. Found 7075545 shorts which is 13MB not including array overhead. Removed 6418975 shorts which is 12MB not counting array overhead. Took 7 ms. 11:17:52.014 [Apex Prelude Service STARTING] INFO a.j.l.i.s.ApexPreludeManagedService - Error while scanning built-in and system Apex types. java.lang.IllegalStateException: Expected the service ApexIndexer [FAILED] to be RUNNING, but the service has FAILED at com.google.common.util.concurrent.AbstractService.checkCurrentState(AbstractService.java:381) at com.google.common.util.concurrent.AbstractService.awaitRunning(AbstractService.java:305) at com.google.common.util.concurrent.AbstractScheduledService.awaitRunning(AbstractScheduledService.java:456) at apex.jorje.lsp.impl.services.ApexPreludeManagedService.startUp(ApexPreludeManagedService.java:157) at com.google.common.util.concurrent.AbstractIdleService$DelegateService$1.run(AbstractIdleService.java:62) at com.google.common.util.concurrent.Callables$4.run(Callables.java:121) at java.base/java.lang.Thread.run(Thread.java:833) Caused by: java.lang.OutOfMemoryError: Java heap space at org.eclipse.jdt.internal.core.nd.db.ShortString.getChars(ShortString.java:69) at org.eclipse.jdt.internal.core.nd.db.ShortString.compare(ShortString.java:155) at org.eclipse.jdt.internal.core.nd.field.FieldSearchIndex$SearchCriteriaToBtreeVisitorAdapter.compare(FieldSearchIndex.java:132) at org.eclipse.jdt.internal.core.nd.db.BTree.accept(BTree.java:628) at org.eclipse.jdt.internal.core.nd.db.BTree.accept(BTree.java:647) at org.eclipse.jdt.internal.core.nd.db.BTree.accept(BTree.java:647) at org.eclipse.jdt.internal.core.nd.db.BTree.accept(BTree.java:647) at org.eclipse.jdt.internal.core.nd.db.BTree.accept(BTree.java:598) at org.eclipse.jdt.internal.core.nd.field.FieldSearchIndex.findBest(FieldSearchIndex.java:232) at apex.jorje.lsp.impl.db.nddb.NdApexIndex.findExactTypeId(NdApexIndex.java:240) at apex.jorje.lsp.impl.symbols.ApexSymbolProvider.getTypeIdDependentOnNamespace(ApexSymbolProvider.java:230) at apex.jorje.lsp.impl.symbols.ApexSymbolProvider.getSObjectType(ApexSymbolProvider.java:176) at apex.jorje.semantic.symbol.resolver.rules.OnePartTypeNameResolveRules$SObject.lookup(OnePartTypeNameResolveRules.java:93) at apex.jorje.semantic.symbol.resolver.rules.TypeNameResolutionOrderUtil.getTypeFromOnePartRules(TypeNameResolutionOrderUtil.java:104) at apex.jorje.semantic.symbol.resolver.rules.TypeNameResolutionOrderUtil.bindToType(TypeNameResolutionOrderUtil.java:55) at apex.jorje.semantic.symbol.resolver.StandardSymbolResolver.lookupTypeInfo(StandardSymbolResolver.java:394) at apex.jorje.semantic.symbol.resolver.StandardSymbolResolver.lookupTypeInfoIdentifiers(StandardSymbolResolver.java:199) at apex.jorje.semantic.symbol.resolver.TypeRefResolvers$ClassTypeResolver.resolve(TypeRefResolvers.java:148) at apex.jorje.semantic.symbol.resolver.StandardSymbolResolver.lookupTypeInfo(StandardSymbolResolver.java:161) at apex.jorje.semantic.ast.expression.InstanceOfExpression.validate(InstanceOfExpression.java:82) at apex.jorje.semantic.ast.condition.StandardCondition.validate(StandardCondition.java:66) at apex.jorje.semantic.ast.statement.IfBlockStatement.validate(IfBlockStatement.java:61) at apex.jorje.semantic.ast.statement.IfElseBlockStatement.validate(IfElseBlockStatement.java:118) at apex.jorje.semantic.ast.statement.BlockStatement.validate(BlockStatement.java:154) at apex.jorje.semantic.ast.statement.MethodBlockStatement.validate(MethodBlockStatement.java:82) at apex.jorje.semantic.ast.member.Method.validate(Method.java:172) at apex.jorje.semantic.ast.compilation.UserClass.validate(UserClass.java:183) at apex.jorje.semantic.compiler.CodeUnit.validate(CodeUnit.java:220) at apex.jorje.semantic.compiler.CompilerOperations$ValidateOperation.invoke(CompilerOperations.java:96) at apex.jorje.semantic.compiler.CompilerStageProcessor.processFirstStage(CompilerStageProcessor.java:136) at apex.jorje.semantic.compiler.CompilerStageProcessor.processToStage(CompilerStageProcessor.java:105) at apex.jorje.semantic.compiler.ApexCompiler.compile(ApexCompiler.java:120) 11:17:52.723 [pool-1-thread-1] ERROR a.j.l.i.services.ApexLanguageServer - Error trying to initialize the language server java.lang.IllegalStateException: Expected to be healthy after starting. The following services are not running: {FAILED=[Apex Prelude Service [FAILED]]} at com.google.common.util.concurrent.ServiceManager$ServiceManagerState.checkHealthy(ServiceManager.java:769) at com.google.common.util.concurrent.ServiceManager$ServiceManagerState.awaitHealthy(ServiceManager.java:581) at com.google.common.util.concurrent.ServiceManager.awaitHealthy(ServiceManager.java:295) at apex.jorje.lsp.impl.services.ApexLanguageServer.initialize(ApexLanguageServer.java:95) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$recursiveFindRpcMethods$0(GenericEndpoint.java:65) at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.request(GenericEndpoint.java:120) at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleRequest(RemoteEndpoint.java:261) at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:190) at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:194) at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94) at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:833) Suppressed: com.google.common.util.concurrent.ServiceManager$FailedService: Apex Prelude Service [FAILED] Caused by: java.lang.RuntimeException: java.lang.IllegalStateException: Expected the service ApexIndexer [FAILED] to be RUNNING, but the service has FAILED at apex.jorje.lsp.impl.services.ApexPreludeManagedService.startUp(ApexPreludeManagedService.java:162) at com.google.common.util.concurrent.AbstractIdleService$DelegateService$1.run(AbstractIdleService.java:62) at com.google.common.util.concurrent.Callables$4.run(Callables.java:121) at java.base/java.lang.Thread.run(Thread.java:833) Caused by: java.lang.IllegalStateException: Expected the service ApexIndexer [FAILED] to be RUNNING, but the service has FAILED at com.google.common.util.concurrent.AbstractService.checkCurrentState(AbstractService.java:381) at com.google.common.util.concurrent.AbstractService.awaitRunning(AbstractService.java:305) at com.google.common.util.concurrent.AbstractScheduledService.awaitRunning(AbstractScheduledService.java:456) at apex.jorje.lsp.impl.services.ApexPreludeManagedService.startUp(ApexPreludeManagedService.java:157) ... 3 common frames omitted Caused by: java.lang.OutOfMemoryError: Java heap space at org.eclipse.jdt.internal.core.nd.db.ShortString.getChars(ShortString.java:69) at org.eclipse.jdt.internal.core.nd.db.ShortString.compare(ShortString.java:155) at org.eclipse.jdt.internal.core.nd.field.FieldSearchIndex$SearchCriteriaToBtreeVisitorAdapter.compare(FieldSearchIndex.java:132) at org.eclipse.jdt.internal.core.nd.db.BTree.accept(BTree.java:628) at org.eclipse.jdt.internal.core.nd.db.BTree.accept(BTree.java:647) at org.eclipse.jdt.internal.core.nd.db.BTree.accept(BTree.java:647) at org.eclipse.jdt.internal.core.nd.db.BTree.accept(BTree.java:647) at org.eclipse.jdt.internal.core.nd.db.BTree.accept(BTree.java:598) at org.eclipse.jdt.internal.core.nd.field.FieldSearchIndex.findBest(FieldSearchIndex.java:232) at apex.jorje.lsp.impl.db.nddb.NdApexIndex.findExactTypeId(NdApexIndex.java:240) at apex.jorje.lsp.impl.symbols.ApexSymbolProvider.getTypeIdDependentOnNamespace(ApexSymbolProvider.java:230) at apex.jorje.lsp.impl.symbols.ApexSymbolProvider.getSObjectType(ApexSymbolProvider.java:176) at apex.jorje.semantic.symbol.resolver.rules.OnePartTypeNameResolveRules$SObject.lookup(OnePartTypeNameResolveRules.java:93) at apex.jorje.semantic.symbol.resolver.rules.TypeNameResolutionOrderUtil.getTypeFromOnePartRules(TypeNameResolutionOrderUtil.java:104) at apex.jorje.semantic.symbol.resolver.rules.TypeNameResolutionOrderUtil.bindToType(TypeNameResolutionOrderUtil.java:55) at apex.jorje.semantic.symbol.resolver.StandardSymbolResolver.lookupTypeInfo(StandardSymbolResolver.java:394) at apex.jorje.semantic.symbol.resolver.StandardSymbolResolver.lookupTypeInfoIdentifiers(StandardSymbolResolver.java:199) at apex.jorje.semantic.symbol.resolver.TypeRefResolvers$ClassTypeResolver.resolve(TypeRefResolvers.java:148) at apex.jorje.semantic.symbol.resolver.StandardSymbolResolver.lookupTypeInfo(StandardSymbolResolver.java:161) at apex.jorje.semantic.ast.expression.InstanceOfExpression.validate(InstanceOfExpression.java:82) at apex.jorje.semantic.ast.condition.StandardCondition.validate(StandardCondition.java:66) at apex.jorje.semantic.ast.statement.IfBlockStatement.validate(IfBlockStatement.java:61) at apex.jorje.semantic.ast.statement.IfElseBlockStatement.validate(IfElseBlockStatement.java:118) at apex.jorje.semantic.ast.statement.BlockStatement.validate(BlockStatement.java:154) at apex.jorje.semantic.ast.statement.MethodBlockStatement.validate(MethodBlockStatement.java:82) at apex.jorje.semantic.ast.member.Method.validate(Method.java:172) at apex.jorje.semantic.ast.compilation.UserClass.validate(UserClass.java:183) at apex.jorje.semantic.compiler.CodeUnit.validate(CodeUnit.java:220) at apex.jorje.semantic.compiler.CompilerOperations$ValidateOperation.invoke(CompilerOperations.java:96) at apex.jorje.semantic.compiler.CompilerStageProcessor.processFirstStage(CompilerStageProcessor.java:136) at apex.jorje.semantic.compiler.CompilerStageProcessor.processToStage(CompilerStageProcessor.java:105) at apex.jorje.semantic.compiler.ApexCompiler.compile(ApexCompiler.java:120) [Error - 11:17:52 AM] Server initialization failed. TypeError: Cannot read properties of null (reading 'capabilities') at H_.doInitialize (c:\Users\a411702\.vscode\extensions\salesforce.salesforcedx-vscode-apex-60.8.0\dist\index.js:181:5812) at async H_.start (c:\Users\a411702\.vscode\extensions\salesforce.salesforcedx-vscode-apex-60.8.0\dist\index.js:181:4599) at async dde (c:\Users\a411702\.vscode\extensions\salesforce.salesforcedx-vscode-apex-60.8.0\dist\index.js:204:5771) at async ade (c:\Users\a411702\.vscode\extensions\salesforce.salesforcedx-vscode-apex-60.8.0\dist\index.js:204:2911) at async a.n (c:\Users\a411702\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:142:6237) at async a.m (c:\Users\a411702\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:142:6200) at async a.l (c:\Users\a411702\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:142:5657) [Error - 11:17:52 AM] Apex Language Server client: couldn't create connection to server. TypeError: Cannot read properties of null (reading 'capabilities') at H_.doInitialize (c:\Users\a411702\.vscode\extensions\salesforce.salesforcedx-vscode-apex-60.8.0\dist\index.js:181:5812) at async H_.start (c:\Users\a411702\.vscode\extensions\salesforce.salesforcedx-vscode-apex-60.8.0\dist\index.js:181:4599) at async dde (c:\Users\a411702\.vscode\extensions\salesforce.salesforcedx-vscode-apex-60.8.0\dist\index.js:204:5771) at async ade (c:\Users\a411702\.vscode\extensions\salesforce.salesforcedx-vscode-apex-60.8.0\dist\index.js:204:2911) at async a.n (c:\Users\a411702\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:142:6237) at async a.m (c:\Users\a411702\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:142:6200) at async a.l (c:\Users\a411702\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:142:5657) [Info - 11:17:58 AM] Connection to server got closed. Server will restart. true 11:18:05.579 [Apex Prelude Service STARTING] INFO a.j.l.i.s.ApexPreludeManagedService - Scanning built-in and system Apex types. 11:18:05.624 [Apex Prelude Service STARTING] INFO a.j.l.i.s.ApexPreludeManagedService - Scanning built-in Apex types. 11:18:05.630 [Apex Prelude Service STARTING] INFO a.j.l.i.s.ApexPreludeManagedService - Collecting built-in standard types from jar 11:18:07.857 [Apex Prelude Service STARTING] INFO a.j.l.i.s.ApexPreludeManagedService - Done collecting built-in standard types from jar 11:18:07.857 [Apex Prelude Service STARTING] INFO a.j.l.i.s.ApexPreludeManagedService - Scanning Apex Standard Library. 11:18:08.374 [Apex Prelude Service STARTING] INFO a.j.l.i.s.ApexPreludeManagedService - Done scanning Apex Standard Library. 11:18:08.377 [Apex Prelude Service STARTING] INFO a.j.l.i.s.ApexPreludeManagedService - Starting ApexIndexer. 11:18:08.377 [ApexIndexer STARTING] INFO a.jorje.lsp.impl.index.ApexIndexer - ApexIndexer: Start indexer. 11:18:08.384 [ApexIndexer STARTING] INFO a.jorje.lsp.impl.index.ApexIndexer - ApexIndexer: Scanning user-defined types. 11:18:08.384 [ApexIndexer STARTING] INFO a.jorje.lsp.impl.index.ApexIndexer - ApexIndexer: Scanning workspace source. 11:18:15.451 [ApexIndexer STARTING] INFO a.jorje.lsp.impl.index.ApexIndexer - ApexIndexer: Building change list. 11:18:16.052 [ApexIndexer STARTING] INFO a.jorje.lsp.impl.index.ApexIndexer - ApexIndexer: Applying found changes 11:18:16.052 [ApexIndexer STARTING] INFO a.jorje.lsp.impl.index.ApexIndexer - ApexIndexer: Creating 6071 Apex artifacts in Apex DB apr 22, 2024 11:18:19 AM apex.jorje.parser.impl.BaseApexLexer dedupe INFO: Deduped array ApexLexer.DFA22_transition. Found 7075545 shorts which is 13MB not including array overhead. Removed 6418975 shorts which is 12MB not counting array overhead. Took 6 ms. 11:20:39.717 [Apex Prelude Service STARTING] INFO a.j.l.i.s.ApexPreludeManagedService - Error while scanning built-in and system Apex types. java.lang.IllegalStateException: Expected the service ApexIndexer [FAILED] to be RUNNING, but the service has FAILED at com.google.common.util.concurrent.AbstractService.checkCurrentState(AbstractService.java:381) at com.google.common.util.concurrent.AbstractService.awaitRunning(AbstractService.java:305) at com.google.common.util.concurrent.AbstractScheduledService.awaitRunning(AbstractScheduledService.java:456) at apex.jorje.lsp.impl.services.ApexPreludeManagedService.startUp(ApexPreludeManagedService.java:157) at com.google.common.util.concurrent.AbstractIdleService$DelegateService$1.run(AbstractIdleService.java:62) at com.google.common.util.concurrent.Callables$4.run(Callables.java:121) at java.base/java.lang.Thread.run(Thread.java:833) Caused by: java.lang.OutOfMemoryError: Java heap space at java.base/java.util.stream.IntPipeline.filter(IntPipeline.java:380) at java.base/java.text.DecimalFormatSymbols.findNonFormatChar(DecimalFormatSymbols.java:843) at java.base/java.text.DecimalFormatSymbols.initialize(DecimalFormatSymbols.java:815) at java.base/java.text.DecimalFormatSymbols.<init>(DecimalFormatSymbols.java:115) at java.base/sun.util.locale.provider.DecimalFormatSymbolsProviderImpl.getInstance(DecimalFormatSymbolsProviderImpl.java:85) at java.base/java.text.DecimalFormatSymbols.getInstance(DecimalFormatSymbols.java:182) at java.base/sun.util.locale.provider.NumberFormatProviderImpl.getInstance(NumberFormatProviderImpl.java:185) at java.base/sun.util.locale.provider.NumberFormatProviderImpl.getNumberInstance(NumberFormatProviderImpl.java:151) at java.base/java.text.NumberFormat.getInstance(NumberFormat.java:976) at java.base/java.text.NumberFormat.getInstance(NumberFormat.java:962) at java.base/java.text.NumberFormat.getInstance(NumberFormat.java:491) at java.base/java.text.MessageFormat.subformat(MessageFormat.java:1296) at java.base/java.text.MessageFormat.format(MessageFormat.java:886) at java.base/java.text.Format.format(Format.java:159) at java.base/java.text.MessageFormat.format(MessageFormat.java:861) at apex.jorje.services.I18nSupport.getLabel(I18nSupport.java:44) at apex.jorje.services.printers.location.LocPrinter.print(LocPrinter.java:37) at apex.jorje.services.printers.location.LocPrinter.print(LocPrinter.java:29) at apex.jorje.semantic.exception.SemanticException.<init>(SemanticException.java:53) at apex.jorje.semantic.exception.SemanticException.<init>(SemanticException.java:49) at apex.jorje.semantic.exception.Errors.lambda$markInvalid$0(Errors.java:147) at apex.jorje.semantic.exception.Errors$$Lambda$472/0x0000000800f039b8.apply(Unknown Source) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) at java.base/java.util.Collections$2.tryAdvance(Collections.java:4853) at java.base/java.util.Collections$2.forEachRemaining(Collections.java:4861) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921) at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682) at apex.jorje.semantic.exception.Errors.markInvalid(Errors.java:148) at apex.jorje.semantic.ast.statement.VariableDeclarationStatements.validate(VariableDeclarationStatements.java:107) 11:20:40.602 [pool-1-thread-1] ERROR a.j.l.i.services.ApexLanguageServer - Error trying to initialize the language server java.lang.IllegalStateException: Expected to be healthy after starting. The following services are not running: {FAILED=[Apex Prelude Service [FAILED]]} at com.google.common.util.concurrent.ServiceManager$ServiceManagerState.checkHealthy(ServiceManager.java:769) at com.google.common.util.concurrent.ServiceManager$ServiceManagerState.awaitHealthy(ServiceManager.java:581) at com.google.common.util.concurrent.ServiceManager.awaitHealthy(ServiceManager.java:295) at apex.jorje.lsp.impl.services.ApexLanguageServer.initialize(ApexLanguageServer.java:95) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$recursiveFindRpcMethods$0(GenericEndpoint.java:65) at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.request(GenericEndpoint.java:120) at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleRequest(RemoteEndpoint.java:261) at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:190) at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:194) at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94) at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:833) Suppressed: com.google.common.util.concurrent.ServiceManager$FailedService: Apex Prelude Service [FAILED] Caused by: java.lang.RuntimeException: java.lang.IllegalStateException: Expected the service ApexIndexer [FAILED] to be RUNNING, but the service has FAILED at apex.jorje.lsp.impl.services.ApexPreludeManagedService.startUp(ApexPreludeManagedService.java:162) at com.google.common.util.concurrent.AbstractIdleService$DelegateService$1.run(AbstractIdleService.java:62) at com.google.common.util.concurrent.Callables$4.run(Callables.java:121) at java.base/java.lang.Thread.run(Thread.java:833) Caused by: java.lang.IllegalStateException: Expected the service ApexIndexer [FAILED] to be RUNNING, but the service has FAILED at com.google.common.util.concurrent.AbstractService.checkCurrentState(AbstractService.java:381) at com.google.common.util.concurrent.AbstractService.awaitRunning(AbstractService.java:305) at com.google.common.util.concurrent.AbstractScheduledService.awaitRunning(AbstractScheduledService.java:456) at apex.jorje.lsp.impl.services.ApexPreludeManagedService.startUp(ApexPreludeManagedService.java:157) ... 3 common frames omitted Caused by: java.lang.OutOfMemoryError: Java heap space at java.base/java.util.stream.IntPipeline.filter(IntPipeline.java:380) at java.base/java.text.DecimalFormatSymbols.findNonFormatChar(DecimalFormatSymbols.java:843) at java.base/java.text.DecimalFormatSymbols.initialize(DecimalFormatSymbols.java:815) at java.base/java.text.DecimalFormatSymbols.<init>(DecimalFormatSymbols.java:115) at java.base/sun.util.locale.provider.DecimalFormatSymbolsProviderImpl.getInstance(DecimalFormatSymbolsProviderImpl.java:85) at java.base/java.text.DecimalFormatSymbols.getInstance(DecimalFormatSymbols.java:182) at java.base/sun.util.locale.provider.NumberFormatProviderImpl.getInstance(NumberFormatProviderImpl.java:185) at java.base/sun.util.locale.provider.NumberFormatProviderImpl.getNumberInstance(NumberFormatProviderImpl.java:151) at java.base/java.text.NumberFormat.getInstance(NumberFormat.java:976) at java.base/java.text.NumberFormat.getInstance(NumberFormat.java:962) at java.base/java.text.NumberFormat.getInstance(NumberFormat.java:491) at java.base/java.text.MessageFormat.subformat(MessageFormat.java:1296) at java.base/java.text.MessageFormat.format(MessageFormat.java:886) at java.base/java.text.Format.format(Format.java:159) at java.base/java.text.MessageFormat.format(MessageFormat.java:861) at apex.jorje.services.I18nSupport.getLabel(I18nSupport.java:44) at apex.jorje.services.printers.location.LocPrinter.print(LocPrinter.java:37) at apex.jorje.services.printers.location.LocPrinter.print(LocPrinter.java:29) at apex.jorje.semantic.exception.SemanticException.<init>(SemanticException.java:53) at apex.jorje.semantic.exception.SemanticException.<init>(SemanticException.java:49) at apex.jorje.semantic.exception.Errors.lambda$markInvalid$0(Errors.java:147) at apex.jorje.semantic.exception.Errors$$Lambda$472/0x0000000800f039b8.apply(Unknown Source) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) at java.base/java.util.Collections$2.tryAdvance(Collections.java:4853) at java.base/java.util.Collections$2.forEachRemaining(Collections.java:4861) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921) at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682) at apex.jorje.semantic.exception.Errors.markInvalid(Errors.java:148) at apex.jorje.semantic.ast.statement.VariableDeclarationStatements.validate(VariableDeclarationStatements.java:107) [Error - 11:20:40 AM] Server initialization failed. TypeError: Cannot read properties of null (reading 'capabilities') at H_.doInitialize (c:\Users\a411702\.vscode\extensions\salesforce.salesforcedx-vscode-apex-60.8.0\dist\index.js:181:5812) at async H_.start (c:\Users\a411702\.vscode\extensions\salesforce.salesforcedx-vscode-apex-60.8.0\dist\index.js:181:4599) [Error - 11:20:40 AM] Apex Language Server client: couldn't create connection to server. TypeError: Cannot read properties of null (reading 'capabilities') at H_.doInitialize (c:\Users\a411702\.vscode\extensions\salesforce.salesforcedx-vscode-apex-60.8.0\dist\index.js:181:5812) at async H_.start (c:\Users\a411702\.vscode\extensions\salesforce.salesforcedx-vscode-apex-60.8.0\dist\index.js:181:4599) [Error - 11:20:40 AM] Restarting server failed TypeError: Cannot read properties of null (reading 'capabilities') at H_.doInitialize (c:\Users\a411702\.vscode\extensions\salesforce.salesforcedx-vscode-apex-60.8.0\dist\index.js:181:5812) at async H_.start (c:\Users\a411702\.vscode\extensions\salesforce.salesforcedx-vscode-apex-60.8.0\dist\index.js:181:4599) [Info - 11:20:43 AM] Connection to server got closed. Server will restart.

SFDX CLI Version: @salesforce/cli/2.37.4 win32-x64 node-v20.11.1

OS and version: WINDOWS 11 22H2 ( build SO22621.3296)

VS Code version:

Version: 1.88.1 (user setup) Commit: e170252f762678dec6ca2cc69aba1570769a5d39 Date: 2024-04-10T17:41:02.734Z Electron: 28.2.8 ElectronBuildId: 27744544 Chromium: 120.0.6099.291 Node.js: 18.18.2 V8: 12.0.267.19-electron.0 OS: Windows_NT x64 10.0.22621

peternhale commented 2 months ago

@gematria do you recall the version details prior to upgrading to version 1.88.1?

The error you are experiencing is a java out of memory error.

Do you have any entries in these setting: (please be sure to check both user and workspace settings)

You can also try to remove the local Apex index files for the Apex language server.

Shutdown vscode Remove the folder .sfdx/tools/248 from your project root directory Start vscode

gematria commented 2 months ago

Do you recall the version details prior to upgrading to version 1.88.1?

I don't know, but I upgrade it regularly, I assume it was the previously released one

Do you have any entries in these settings: (please be sure to check both user and workspace settings)

Salesforcedx-vscode-apex › Java: Memory
Salesforcedx-vscode-apex › Java: Home
If so, please share those values.

I've none of them

Shutdown vscode Remove the folder .sfdx/tools/248 from your project root directory Start vscode

That folder does not exist in my project root directory

I suppose the error depend on the size of my project, on the smaller ones I've noticed it works fine, but passed a certain threshold, that I ignore at the moment, and the server starts failing.

mingxuanzhangsfdx commented 2 months ago

@gematria -

Based on your error log, this is failing due to omitted Caused by: java.lang.OutOfMemoryError: Java heap space at java.base/java.util.stream.IntPipeline.filter(IntPipeline.java:380) at.

You should try to increase the java heap size by specifying the memory you would like to allocate in both the User and Workspace setting of Salesforcedx-vscode-apex › Java: Memory and then reload your workspace by always removing the folder .sfdx/tools/248 from your project root directory and starting VS Code again.

peternhale commented 2 months ago

@gematria have had an opportunity to try increasing the java memory?

github-actions[bot] commented 2 months ago

This issue has not received a response in 3 days. It will auto-close in 2 days unless a response is posted.