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

CodeNarcServer unexpected error Request failed with status code 500 #137

Closed
french0u0 opened this issue Jan 6, 2022 · 15 comments · Fixed by nvuillam/npm-groovy-lint#357
Closed

Comments

@french0u0
Copy link

Hi!

I'm on Windows 10 on my work laptop and I'm trying to use your extension.
Starting a command prompt and npm install npm-groovy-lint (can't remember exact syntax for installing) and then going npm-groovy-lint in a folder with my groovy works.

However VsCode -> Extensions -> install your extension -> right click groovy -> analyze code doesn't work.
I get this as output:
Start analyzing file:///c%3A/Users/fjacobs/Documents/workspace/Repos/gitrepos/XFIL-2D-Git/XFIL-2D/JenkinsCI/XFIL-2D%20build%20pipeline.groovy
GroovyLint: Started CodeNarc Server
CodeNarcServer unexpected error:
{
"message": "Request failed with status code 500",
"name": "Error",
"stack": "Error: Request failed with status code 500\n at createError (c:\Users\fjacobs\.vscode\extensions\nicolasvuillamy.vscode-groovy-lint-1.7.2\server\node_modules\axios\lib\core\createError.js:16:15)\n at settle (c:\Users\fjacobs\.vscode\extensions\nicolasvuillamy.vscode-groovy-lint-1.7.2\server\node_modules\axios\lib\core\settle.js:17:12)\n at IncomingMessage.handleStreamEnd (c:\Users\fjacobs\.vscode\extensions\nicolasvuillamy.vscode-groovy-lint-1.7.2\server\node_modules\axios\lib\adapters\http.js:269:11)\n at IncomingMessage.emit (events.js:327:22)\n at endReadableNT (internal/streams/readable.js:1327:12)\n at processTicksAndRejections (internal/process/task_queues.js:80:21)",
"config": {
"url": "http://localhost:7484/request",
"method": "post",
"data": "{"codeNarcArgs":"-basedir=C:\\Users\\fjacobs\\AppData\\Local\\Temp\\npm-groovy-lint\\codeNarcTmpDir_0.06463452145928161 -ruleset=%7B%22AbstractClassName%22%3A%7B%7D%2C%22AbstractClassWithoutAbstractMethod%22%3A%7B%7D%2C%22AbstractClassWithPublicConstructor%22%3A%7B%7D%2C%22AddEmptyString%22%3A%7B%7D%2C%22AssertWithinFinallyBlock%22%3A%7B%7D%2C%22AssignCollectionSort%22%3A%7B%7D%2C%22AssignCollectionUnique%22%3A%7B%7D%2C%22AssignmentInConditional%22%3A%7B%7D%2C%22AssignmentToStaticFieldFromInstanceMethod%22%3A%7B%7D%2C%22BigDecimalInstantiation%22%3A%7B%7D%2C%22BitwiseOperatorInConditional%22%3A%7B%7D%2C%22BlankLineBeforePackage%22%3A%7B%7D%2C%22BlockEndsWithBlankLine%22%3A%7B%7D%2C%22BlockStartsWithBlankLine%22%3A%7B%7D%2C%22BooleanGetBoolean%22%3A%7B%7D%2C%22BooleanMethodReturnsNull%22%3A%7B%7D%2C%22BracesForClass%22%3A%7B%22priority%22%3A3%7D%2C%22BracesForForLoop%22%3A%7B%22priority%22%3A3%7D%2C%22BracesForIfElse%22%3A%7B%22priority%22%3A3%7D%2C%22BracesForMethod%22%3A%7B%22priority%22%3A3%7D%2C%22BracesForTryCatchFinally%22%3A%7B%22priority%22%3A3%7D%2C%22BrokenNullCheck%22%3A%7B%7D%2C%22BrokenOddnessCheck%22%3A%7B%7D%2C%22BuilderMethodWithSideEffects%22%3A%7B%7D%2C%22BusyWait%22%3A%7B%7D%2C%22CatchArrayIndexOutOfBoundsException%22%3A%7B%7D%2C%22CatchError%22%3A%7B%7D%2C%22CatchException%22%3A%7B%7D%2C%22CatchIllegalMonitorStateException%22%3A%7B%7D%2C%22CatchIndexOutOfBoundsException%22%3A%7B%7D%2C%22CatchNullPointerException%22%3A%7B%7D%2C%22CatchRuntimeException%22%3A%7B%7D%2C%22CatchThrowable%22%3A%7B%7D%2C%22ChainedTest%22%3A%7B%7D%2C%22ClassEndsWithBlankLine%22%3A%7B%7D%2C%22ClassForName%22%3A%7B%7D%2C%22ClassJavadoc%22%3A%7B%7D%2C%22ClassName%22%3A%7B%7D%2C%22ClassNameSameAsFilename%22%3A%7B%7D%2C%22ClassNameSameAsSuperclass%22%3A%7B%7D%2C%22ClassSize%22%3A%7B%7D%2C%22ClassStartsWithBlankLine%22%3A%7B%7D%2C%22CloneableWithoutClone%22%3A%7B%7D%2C%22CloneWithoutCloneable%22%3A%7B%7D%2C%22CloseWithoutCloseable%22%3A%7B%7D%2C%22ClosureAsLastMethodParameter%22%3A%7B%7D%2C%22ClosureStatementOnOpeningLineOfMultipleLineClosure%22%3A%7B%7D%2C%22CollectAllIsDeprecated%22%3A%7B%7D%2C%22CompareToWithoutComparable%22%3A%7B%7D%2C%22ComparisonOfTwoConstants%22%3A%7B%7D%2C%22ComparisonWithSelf%22%3A%7B%7D%2C%22CompileStatic%22%3A%7B%22priority%22%3A3%7D%2C%22ConfusingClassNamedException%22%3A%7B%7D%2C%22ConfusingMethodName%22%3A%7B%7D%2C%22ConfusingMultipleReturns%22%3A%7B%7D%2C%22ConfusingTernary%22%3A%7B%7D%2C%22ConsecutiveBlankLines%22%3A%7B%7D%2C%22ConsecutiveLiteralAppends%22%3A%7B%7D%2C%22ConsecutiveStringConcatenation%22%3A%7B%7D%2C%22ConstantAssertExpression%22%3A%7B%7D%2C%22ConstantIfExpression%22%3A%7B%7D%2C%22ConstantsOnlyInterface%22%3A%7B%7D%2C%22ConstantTernaryExpression%22%3A%7B%7D%2C%22CouldBeElvis%22%3A%7B%7D%2C%22CouldBeSwitchStatement%22%3A%7B%7D%2C%22CoupledTestCase%22%3A%7B%7D%2C%22DeadCode%22%3A%7B%22priority%22%3A1%7D%2C%22DirectConnectionManagement%22%3A%7B%7D%2C%22DoubleCheckedLocking%22%3A%7B%7D%2C%22DoubleNegative%22%3A%7B%7D%2C%22DuplicateCaseStatement%22%3A%7B%7D%2C%22DuplicateImport%22%3A%7B%7D%2C%22DuplicateListLiteral%22%3A%7B%22priority%22%3A3%7D%2C%22DuplicateMapKey%22%3A%7B%7D%2C%22DuplicateMapLiteral%22%3A%7B%22priority%22%3A2%7D%2C%22DuplicateNumberLiteral%22%3A%7B%22priority%22%3A3%2C%22ignoreNumbers%22%3A%5B0%2C1%2C2%2C3%2C-1%5D%7D%2C%22DuplicateSetValue%22%3A%7B%7D%2C%22DuplicateStringLiteral%22%3A%7B%22priority%22%3A3%7D%2C%22ElseBlockBraces%22%3A%7B%7D%2C%22EmptyCatchBlock%22%3A%7B%7D%2C%22EmptyClass%22%3A%7B%7D%2C%22EmptyElseBlock%22%3A%7B%7D%2C%22EmptyFinallyBlock%22%3A%7B%7D%2C%22EmptyForStatement%22%3A%7B%7D%2C%22EmptyIfStatement%22%3A%7B%7D%2C%22EmptyInstanceInitializer%22%3A%7B%7D%2C%22EmptyMethod%22%3A%7B%7D%2C%22EmptyMethodInAbstractClass%22%3A%7B%7D%2C%22EmptyStaticInitializer%22%3A%7B%7D%2C%22EmptySwitchStatement%22%3A%7B%7D%2C%22EmptySynchronizedStatement%22%3A%7B%7D%2C%22EmptyTryBlock%22%3A%7B%7D%2C%22EmptyWhileStatement%22%3A%7B%7D%2C%22EnumCustomSerializationIgnored%22%3A%7B%7D%2C%22EqualsAndHashCode%22%3A%7B%7D%2C%22EqualsOverloaded%22%3A%7B%7D%2C%22ExceptionExtendsError%22%3A%7B%7D%2C%22ExceptionExtendsThrowable%22%3A%7B%7D%2C%22ExceptionNotThrown%22%3A%7B%7D%2C%22ExplicitArrayListInstantiation%22%3A%7B%7D%2C%22ExplicitCallToAndMethod%22%3A%7B%7D%2C%22ExplicitCallToCompareToMethod%22%3A%7B%7D%2C%22ExplicitCallToDivMethod%22%3A%7B%7D%2C%22ExplicitCallToEqualsMethod%22%3A%7B%22priority%22%3A3%7D%2C%22ExplicitCallToGetAtMethod%22%3A%7B%7D%2C%22ExplicitCallToLeftShiftMethod%22%3A%7B%7D%2C%22ExplicitCallToMinusMethod%22%3A%7B%7D%2C%22ExplicitCallToModMethod%22%3A%7B%7D%2C%22ExplicitCallToMultiplyMethod%22%3A%7B%7D%2C%22ExplicitCallToOrMethod%22%3A%7B%7D%2C%22ExplicitCallToPlusMethod%22%3A%7B%7D%2C%22ExplicitCallToPowerMethod%22%3A%7B%7D%2C%22ExplicitCallToPutAtMethod%22%3A%7B%7D%2C%22ExplicitCallToRightShiftMethod%22%3A%7B%7D%2C%22ExplicitCallToXorMethod%22%3A%7B%7D%2C%22ExplicitGarbageCollection%22%3A%7B%7D%2C%22ExplicitHashMapInstantiation%22%3A%7B%7D%2C%22ExplicitHashSetInstantiation%22%3A%7B%7D%2C%22ExplicitLinkedHashMapInstantiation%22%3A%7B%7D%2C%22ExplicitLinkedListInstantiation%22%3A%7B%7D%2C%22ExplicitStackInstantiation%22%3A%7B%7D%2C%22ExplicitTreeSetInstantiation%22%3A%7B%7D%2C%22FactoryMethodName%22%3A%7B%7D%2C%22FieldName%22%3A%7B%7D%2C%22FieldTypeRequired%22%3A%7B%22priority%22%3A3%7D%2C%22FileCreateTempFile%22%3A%7B%7D%2C%22FileEndsWithoutNewline%22%3A%7B%7D%2C%22FinalClassWithProtectedMember%22%3A%7B%7D%2C%22ForLoopShouldBeWhileLoop%22%3A%7B%7D%2C%22ForStatementBraces%22%3A%7B%7D%2C%22GetterMethodCouldBeProperty%22%3A%7B%7D%2C%22GrailsDomainGormMethods%22%3A%7B%7D%2C%22GrailsDomainHasEquals%22%3A%7B%7D%2C%22GrailsDomainHasToString%22%3A%7B%7D%2C%22GrailsDomainReservedSqlKeywordName%22%3A%7B%7D%2C%22GrailsDomainStringPropertyMaxSize%22%3A%7B%7D%2C%22GrailsDomainWithServiceReference%22%3A%7B%7D%2C%22GrailsDuplicateConstraint%22%3A%7B%7D%2C%22GrailsDuplicateMapping%22%3A%7B%7D%2C%22GrailsMassAssignment%22%3A%7B%7D%2C%22GrailsPublicControllerMethod%22%3A%7B%7D%2C%22GrailsServletContextReference%22%3A%7B%7D%2C%22GrailsStatelessService%22%3A%7B%7D%2C%22GroovyLangImmutable%22%3A%7B%7D%2C%22GStringAsMapKey%22%3A%7B%7D%2C%22GStringExpressionWithinString%22%3A%7B%7D%2C%22HardCodedWindowsFileSeparator%22%3A%7B%7D%2C%22HardCodedWindowsRootDirectory%22%3A%7B%7D%2C%22HashtableIsObsolete%22%3A%7B%7D%2C%22IfStatementBraces%22%3A%7B%7D%2C%22IfStatementCouldBeTernary%22%3A%7B%22priority%22%3A3%7D%2C%22IllegalClassMember%22%3A%7B%7D%2C%22IllegalClassReference%22%3A%7B%7D%2C%22IllegalPackageReference%22%3A%7B%7D%2C%22IllegalRegex%22%3A%7B%7D%2C%22IllegalString%22%3A%7B%7D%2C%22IllegalSubclass%22%3A%7B%7D%2C%22ImplementationAsType%22%3A%7B%7D%2C%22ImplicitClosureParameter%22%3A%7B%7D%2C%22ImplicitReturnStatement%22%3A%7B%7D%2C%22ImportFromSamePackage%22%3A%7B%7D%2C%22ImportFromSunPackages%22%3A%7B%7D%2C%22InconsistentPropertyLocking%22%3A%7B%7D%2C%22InconsistentPropertySynchronization%22%3A%7B%7D%2C%22Indentation%22%3A%7B%22priority%22%3A3%2C%22spacesPerIndentLevel%22%3A4%2C%22enabled%22%3Afalse%7D%2C%22InsecureRandom%22%3A%7B%7D%2C%22Instanceof%22%3A%7B%7D%2C%22IntegerGetInteger%22%3A%7B%7D%2C%22InterfaceName%22%3A%7B%7D%2C%22InterfaceNameSameAsSuperInterface%22%3A%7B%7D%2C%22InvertedCondition%22%3A%7B%7D%2C%22InvertedIfElse%22%3A%7B%7D%2C%22JavadocConsecutiveEmptyLines%22%3A%7B%7D%2C%22JavadocEmptyAuthorTag%22%3A%7B%7D%2C%22JavadocEmptyExceptionTag%22%3A%7B%7D%2C%22JavadocEmptyFirstLine%22%3A%7B%7D%2C%22JavadocEmptyLastLine%22%3A%7B%7D%2C%22JavadocEmptyParamTag%22%3A%7B%7D%2C%22JavadocEmptyReturnTag%22%3A%7B%7D%2C%22JavadocEmptySeeTag%22%3A%7B%7D%2C%22JavadocEmptySinceTag%22%3A%7B%7D%2C%22JavadocEmptyThrowsTag%22%3A%7B%7D%2C%22JavadocEmptyVersionTag%22%3A%7B%7D%2C%22JavadocMissingExceptionDescription%22%3A%7B%7D%2C%22JavadocMissingParamDescription%22%3A%7B%7D%2C%22JavadocMissingThrowsDescription%22%3A%7B%7D%2C%22JavaIoPackageAccess%22%3A%7B%7D%2C%22JdbcConnectionReference%22%3A%7B%7D%2C%22JdbcResultSetReference%22%3A%7B%7D%2C%22JdbcStatementReference%22%3A%7B%7D%2C%22JUnitAssertAlwaysFails%22%3A%7B%7D%2C%22JUnitAssertAlwaysSucceeds%22%3A%7B%7D%2C%22JUnitAssertEqualsConstantActualValue%22%3A%7B%7D%2C%22JUnitFailWithoutMessage%22%3A%7B%7D%2C%22JUnitLostTest%22%3A%7B%7D%2C%22JUnitPublicField%22%3A%7B%7D%2C%22JUnitPublicNonTestMethod%22%3A%7B%7D%2C%22JUnitPublicProperty%22%3A%7B%7D%2C%22JUnitSetUpCallsSuper%22%3A%7B%7D%2C%22JUnitStyleAssertions%22%3A%7B%7D%2C%22JUnitTearDownCallsSuper%22%3A%7B%7D%2C%22JUnitTestMethodWithoutAssert%22%3A%7B%7D%2C%22JUnitUnnecessarySetUp%22%3A%7B%7D%2C%22JUnitUnnecessaryTearDown%22%3A%7B%7D%2C%22JUnitUnnecessaryThrowsException%22%3A%7B%7D%2C%22LineLength%22%3A%7B%7D%2C%22LocaleSetDefault%22%3A%7B%7D%2C%22LoggerForDifferentClass%22%3A%7B%7D%2C%22LoggerWithWrongModifiers%22%3A%7B%7D%2C%22LoggingSwallowsStacktrace%22%3A%7B%7D%2C%22LongLiteralWithLowerCaseL%22%3A%7B%7D%2C%22MethodCount%22%3A%7B%7D%2C%22MethodName%22%3A%7B%7D%2C%22MethodParameterTypeRequired%22%3A%7B%7D%2C%22MethodReturnTypeRequired%22%3A%7B%7D%2C%22MethodSize%22%3A%7B%7D%2C%22MisorderedStaticImports%22%3A%7B%7D%2C%22MissingBlankLineAfterImports%22%3A%7B%7D%2C%22MissingBlankLineAfterPackage%22%3A%7B%7D%2C%22MissingBlankLineBeforeAnnotatedField%22%3A%7B%7D%2C%22MissingNewInThrowStatement%22%3A%7B%7D%2C%22MissingOverrideAnnotation%22%3A%7B%7D%2C%22MultipleLoggers%22%3A%7B%7D%2C%22MultipleUnaryOperators%22%3A%7B%7D%2C%22NestedBlockDepth%22%3A%7B%7D%2C%22NestedForLoop%22%3A%7B%7D%2C%22NestedSynchronization%22%3A%7B%7D%2C%22NoDef%22%3A%7B%22priority%22%3A3%7D%2C%22NoDouble%22%3A%7B%7D%2C%22NoFloat%22%3A%7B%7D%2C%22NoJavaUtilDate%22%3A%7B%7D%2C%22NonFinalPublicField%22%3A%7B%7D%2C%22NonFinalSubclassOfSensitiveInterface%22%3A%7B%7D%2C%22NoTabCharacter%22%3A%7B%7D%2C%22NoWildcardImports%22%3A%7B%7D%2C%22ObjectFinalize%22%3A%7B%7D%2C%22ObjectOverrideMisspelledMethodName%22%3A%7B%7D%2C%22OptionalCollectionReturnType%22%3A%7B%7D%2C%22OptionalField%22%3A%7B%7D%2C%22OptionalMethodParameter%22%3A%7B%7D%2C%22PackageName%22%3A%7B%7D%2C%22PackageNameMatchesFilePath%22%3A%7B%7D%2C%22ParameterAssignmentInFilterClosure%22%3A%7B%7D%2C%22ParameterCount%22%3A%7B%7D%2C%22ParameterName%22%3A%7B%7D%2C%22ParameterReassignment%22%3A%7B%7D%2C%22PrintStackTrace%22%3A%7B%7D%2C%22PrivateFieldCouldBeFinal%22%3A%7B%7D%2C%22PropertyName%22%3A%7B%7D%2C%22PublicFinalizeMethod%22%3A%7B%7D%2C%22PublicInstanceField%22%3A%7B%7D%2C%22PublicMethodsBeforeNonPublicMethods%22%3A%7B%7D%2C%22RandomDoubleCoercedToZero%22%3A%7B%7D%2C%22RemoveAllOnSelf%22%3A%7B%7D%2C%22RequiredRegex%22%3A%7B%7D%2C%22RequiredString%22%3A%7B%7D%2C%22ReturnFromFinallyBlock%22%3A%7B%7D%2C%22ReturnNullFromCatchBlock%22%3A%7B%7D%2C%22ReturnsNullInsteadOfEmptyArray%22%3A%7B%7D%2C%22ReturnsNullInsteadOfEmptyCollection%22%3A%7B%7D%2C%22SerializableClassMustDefineSerialVersionUID%22%3A%7B%7D%2C%22SerialPersistentFields%22%3A%7B%7D%2C%22SerialVersionUID%22%3A%7B%7D%2C%22SimpleDateFormatMissingLocale%22%3A%7B%7D%2C%22SpaceAfterCatch%22%3A%7B%7D%2C%22SpaceAfterClosingBrace%22%3A%7B%7D%2C%22SpaceAfterComma%22%3A%7B%7D%2C%22SpaceAfterFor%22%3A%7B%7D%2C%22SpaceAfterIf%22%3A%7B%7D%2C%22SpaceAfterMethodCallName%22%3A%7B%7D%2C%22SpaceAfterMethodDeclarationName%22%3A%7B%7D%2C%22SpaceAfterNotOperator%22%3A%7B%7D%2C%22SpaceAfterOpeningBrace%22%3A%7B%7D%2C%22SpaceAfterSemicolon%22%3A%7B%7D%2C%22SpaceAfterSwitch%22%3A%7B%7D%2C%22SpaceAfterWhile%22%3A%7B%7D%2C%22SpaceAroundClosureArrow%22%3A%7B%7D%2C%22SpaceAroundOperator%22%3A%7B%7D%2C%22SpaceBeforeClosingBrace%22%3A%7B%7D%2C%22SpaceBeforeOpeningBrace%22%3A%7B%7D%2C%22SpaceInsideParentheses%22%3A%7B%7D%2C%22SpockIgnoreRestUsed%22%3A%7B%7D%2C%22StatelessClass%22%3A%7B%7D%2C%22StatelessSingleton%22%3A%7B%7D%2C%22StaticCalendarField%22%3A%7B%7D%2C%22StaticConnection%22%3A%7B%7D%2C%22StaticDateFormatField%22%3A%7B%7D%2C%22StaticFieldsBeforeInstanceFields%22%3A%7B%7D%2C%22StaticMatcherField%22%3A%7B%7D%2C%22StaticMethodsBeforeInstanceMethods%22%3A%7B%7D%2C%22StaticSimpleDateFormatField%22%3A%7B%7D%2C%22SwallowThreadDeath%22%3A%7B%7D%2C%22SynchronizedMethod%22%3A%7B%7D%2C%22SynchronizedOnBoxedPrimitive%22%3A%7B%7D%2C%22SynchronizedOnGetClass%22%3A%7B%7D%2C%22SynchronizedOnReentrantLock%22%3A%7B%7D%2C%22SynchronizedOnString%22%3A%7B%7D%2C%22SynchronizedOnThis%22%3A%7B%7D%2C%22SynchronizedReadObjectMethod%22%3A%7B%7D%2C%22SystemErrPrint%22%3A%7B%7D%2C%22SystemExit%22%3A%7B%7D%2C%22SystemOutPrint%22%3A%7B%7D%2C%22SystemRunFinalizersOnExit%22%3A%7B%7D%2C%22TernaryCouldBeElvis%22%3A%7B%7D%2C%22ThisReferenceEscapesConstructor%22%3A%7B%7D%2C%22ThreadGroup%22%3A%7B%7D%2C%22ThreadLocalNotStaticFinal%22%3A%7B%7D%2C%22ThreadYield%22%3A%7B%7D%2C%22ThrowError%22%3A%7B%7D%2C%22ThrowException%22%3A%7B%22priority%22%3A3%7D%2C%22ThrowExceptionFromFinallyBlock%22%3A%7B%7D%2C%22ThrowNullPointerException%22%3A%7B%22priority%22%3A3%7D%2C%22ThrowRuntimeException%22%3A%7B%22priority%22%3A3%7D%2C%22ThrowThrowable%22%3A%7B%22priority%22%3A3%7D%2C%22ToStringReturnsNull%22%3A%7B%7D%2C%22TrailingWhitespace%22%3A%7B%7D%2C%22UnnecessaryBigDecimalInstantiation%22%3A%7B%7D%2C%22UnnecessaryBigIntegerInstantiation%22%3A%7B%7D%2C%22UnnecessaryBooleanExpression%22%3A%7B%7D%2C%22UnnecessaryBooleanInstantiation%22%3A%7B%7D%2C%22UnnecessaryCallForLastElement%22%3A%7B%7D%2C%22UnnecessaryCallToSubstring%22%3A%7B%7D%2C%22UnnecessaryCast%22%3A%7B%7D%2C%22UnnecessaryCatchBlock%22%3A%7B%7D%2C%22UnnecessaryCollectCall%22%3A%7B%7D%2C%22UnnecessaryCollectionCall%22%3A%7B%7D%2C%22UnnecessaryConstructor%22%3A%7B%7D%2C%22UnnecessaryDefInFieldDeclaration%22%3A%7B%7D%2C%22UnnecessaryDefInMethodDeclaration%22%3A%7B%7D%2C%22UnnecessaryDefInVariableDeclaration%22%3A%7B%7D%2C%22UnnecessaryDotClass%22%3A%7B%7D%2C%22UnnecessaryDoubleInstantiation%22%3A%7B%7D%2C%22UnnecessaryElseStatement%22%3A%7B%7D%2C%22UnnecessaryFail%22%3A%7B%7D%2C%22UnnecessaryFinalOnPrivateMethod%22%3A%7B%7D%2C%22UnnecessaryFloatInstantiation%22%3A%7B%7D%2C%22UnnecessaryGetter%22%3A%7B%7D%2C%22UnnecessaryGroovyImport%22%3A%7B%7D%2C%22UnnecessaryGString%22%3A%7B%7D%2C%22UnnecessaryIfStatement%22%3A%7B%7D%2C%22UnnecessaryInstanceOfCheck%22%3A%7B%7D%2C%22UnnecessaryInstantiationToGetClass%22%3A%7B%7D%2C%22UnnecessaryIntegerInstantiation%22%3A%7B%7D%2C%22UnnecessaryLongInstantiation%22%3A%7B%7D%2C%22UnnecessaryModOne%22%3A%7B%7D%2C%22UnnecessaryNullCheck%22%3A%7B%7D%2C%22UnnecessaryNullCheckBeforeInstanceOf%22%3A%7B%7D%2C%22UnnecessaryObjectReferences%22%3A%7B%7D%2C%22UnnecessaryOverridingMethod%22%3A%7B%7D%2C%22UnnecessaryPackageReference%22%3A%7B%7D%2C%22UnnecessaryParenthesesForMethodCallWithClosure%22%3A%7B%7D%2C%22UnnecessaryPublicModifier%22%3A%7B%7D%2C%22UnnecessarySafeNavigationOperator%22%3A%7B%7D%2C%22UnnecessarySelfAssignment%22%3A%7B%7D%2C%22UnnecessarySemicolon%22%3A%7B%7D%2C%22UnnecessarySetter%22%3A%7B%7D%2C%22UnnecessaryStringInstantiation%22%3A%7B%7D%2C%22UnnecessarySubstring%22%3A%7B%7D%2C%22UnnecessaryTernaryExpression%22%3A%7B%7D%2C%22UnnecessaryToString%22%3A%7B%7D%2C%22UnnecessaryTransientModifier%22%3A%7B%7D%2C%22UnsafeArrayDeclaration%22%3A%7B%7D%2C%22UnsafeImplementationAsMap%22%3A%7B%7D%2C%22UnusedArray%22%3A%7B%22priority%22%3A1%7D%2C%22UnusedImport%22%3A%7B%7D%2C%22UnusedMethodParameter%22%3A%7B%7D%2C%22UnusedObject%22%3A%7B%22priority%22%3A1%7D%2C%22UnusedPrivateField%22%3A%7B%22priority%22%3A1%7D%2C%22UnusedPrivateMethod%22%3A%7B%22priority%22%3A1%7D%2C%22UnusedPrivateMethodParameter%22%3A%7B%22priority%22%3A1%7D%2C%22UnusedVariable%22%3A%7B%22priority%22%3A1%7D%2C%22UseAssertEqualsInsteadOfAssertTrue%22%3A%7B%7D%2C%22UseAssertFalseInsteadOfNegation%22%3A%7B%7D%2C%22UseAssertNullInsteadOfAssertEquals%22%3A%7B%7D%2C%22UseAssertSameInsteadOfAssertTrue%22%3A%7B%7D%2C%22UseAssertTrueInsteadOfAssertEquals%22%3A%7B%7D%2C%22UseAssertTrueInsteadOfNegation%22%3A%7B%7D%2C%22UseCollectMany%22%3A%7B%7D%2C%22UseCollectNested%22%3A%7B%7D%2C%22UseOfNotifyMethod%22%3A%7B%7D%2C%22VariableName%22%3A%7B%7D%2C%22VariableTypeRequired%22%3A%7B%22priority%22%3A3%7D%2C%22VectorIsObsolete%22%3A%7B%7D%2C%22VolatileArrayField%22%3A%7B%7D%2C%22VolatileLongOrDoubleField%22%3A%7B%7D%2C%22WaitOutsideOfWhileLoop%22%3A%7B%7D%2C%22WhileStatementBraces%22%3A%7B%7D%7D -includes=/XFIL-2D build pipeline.groovy -report=json:stdout","codeNarcBaseDir":"C:\\Users\\fjacobs\\AppData\\Local\\Temp\\npm-groovy-lint\\codeNarcTmpDir_0.06463452145928161","codeNarcIncludes":"/XFIL-2D build pipeline.groovy","parse":true,"file":"C:\\Users\\fjacobs\\AppData\\Local\\Temp\\npm-groovy-lint\\codeNarcTmpDir_0.06463452145928161\\XFIL-2D build pipeline.groovy","requestKey":"c:\\Users\\fjacobs\\Documents\\workspace\\Repos\\gitrepos\\XFIL-2D-Git\\XFIL-2D\\JenkinsCI\\XFIL-2D build pipeline.groovy-none"}",
"headers": {
"Accept": "application/json, text/plain, /",
"Content-Type": "application/json",
"User-Agent": "axios/0.21.4",
"Content-Length": 16692
},
"transformRequest": [
null
],
"transformResponse": [
null
],
"timeout": 600000,
"xsrfCookieName": "XSRF-TOKEN",
"xsrfHeaderName": "X-XSRF-TOKEN",
"maxContentLength": -1,
"maxBodyLength": -1,
"transitional": {
"silentJSONParsing": true,
"forcedJSONParsing": true,
"clarifyTimeoutError": false
}
}
}
"org.codehaus.groovy.runtime.InvokerHelper.assertFailed(InvokerHelper.java:438)\norg.codehaus.groovy.runtime.ScriptBytecodeAdapter.assertFailed(ScriptBytecodeAdapter.java:670)\norg.codenarc.CodeNarc$_parseArgs_closure3.doCall(CodeNarc.groovy:224)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)\njava.lang.reflect.Method.invoke(Unknown Source)\norg.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:107)\ngroovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)\norg.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:274)\ngroovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1035)\ngroovy.lang.Closure.call(Closure.java:412)\ngroovy.lang.Closure.call(Closure.java:428)\norg.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2164)\norg.codehaus.groovy.runtime.dgm$197.invoke(Unknown Source)\norg.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:247)\norg.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:56)\norg.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)\norg.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)\norg.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:139)\norg.codenarc.CodeNarc.parseArgs(CodeNarc.groovy:221)\norg.codenarc.CodeNarc.execute(CodeNarc.groovy:168)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)\njava.lang.reflect.Method.invoke(Unknown Source)\norg.codehaus.groovy.runtime.callsite.PlainObjectMetaMethodSite.doInvoke(PlainObjectMetaMethodSite.java:43)\norg.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:193)\norg.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.call(PogoMetaMethodSite.java:73)\norg.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)\norg.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)\norg.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:139)\ncom.nvuillam.CodeNarcServer.runCodeNarc(CodeNarcServer.groovy:183)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)\njava.lang.reflect.Method.invoke(Unknown Source)\norg.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:107)\ngroovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)\ngroovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1268)\ngroovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1035)\ngroovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:819)\ngroovy.lang.GroovyObject.invokeMethod(GroovyObject.java:39)\norg.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:68)\norg.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:51)\norg.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:171)\norg.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:185)\ncom.nvuillam.CodeNarcServer$_initialize_closure3$_closure10.doCall(CodeNarcServer.groovy:134)\ncom.nvuillam.CodeNarcServer$_initialize_closure3$_closure10.doCall(CodeNarcServer.groovy)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)\njava.lang.reflect.Method.invoke(Unknown Source)\norg.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:107)\ngroovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)\norg.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:274)\ngroovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1035)\norg.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:38)\norg.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)\norg.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)\norg.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:130)\ncom.nvuillam.CodeNarcServer.captureSystemOut(CodeNarcServer.groovy:326)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)\njava.lang.reflect.Method.invoke(Unknown Source)\norg.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:107)\ngroovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)\norg.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:362)\norg.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:61)\norg.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:51)\norg.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:171)\norg.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:185)\ncom.nvuillam.CodeNarcServer$_initialize_closure3.doCall(CodeNarcServer.groovy:133)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)\njava.lang.reflect.Method.invoke(Unknown Source)\norg.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:107)\ngroovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)\norg.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:274)\ngroovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1035)\ngroovy.lang.Closure.call(Closure.java:412)\norg.codehaus.groovy.runtime.ConvertedClosure.invokeCustom(ConvertedClosure.java:50)\norg.codehaus.groovy.runtime.ConversionHandler.invoke(ConversionHandler.java:110)\ncom.sun.proxy.$Proxy7.handle(Unknown Source)\ncom.sun.net.httpserver.Filter$Chain.doFilter(Unknown Source)\nsun.net.httpserver.AuthFilter.doFilter(Unknown Source)\ncom.sun.net.httpserver.Filter$Chain.doFilter(Unknown Source)\nsun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(Unknown Source)\ncom.sun.net.httpserver.Filter$Chain.doFilter(Unknown Source)\nsun.net.httpserver.ServerImpl$Exchange.run(Unknown Source)\njava.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)\njava.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)\njava.lang.Thread.run(Unknown Source)"
GroovyLint: Error running CodeNarc:
java.lang.AssertionError: Invalid argument format: [build]. Expression: matcher. Values: matcher = java.util.regex.Matcher[pattern=-(.)=(.) region=0,5 lastmatch=]
at org.codehaus.groovy.runtime.InvokerHelper.assertFailed(InvokerHelper.java:438)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.assertFailed(ScriptBytecodeAdapter.java:670)
at org.codenarc.CodeNarc$_parseArgs_closure3.doCall(CodeNarc.groovy:224)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:107)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:274)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1035)
at groovy.lang.Closure.call(Closure.java:412)
at groovy.lang.Closure.call(Closure.java:428)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2164)
at org.codehaus.groovy.runtime.dgm$197.invoke(Unknown Source)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:247)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:56)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:139)
at org.codenarc.CodeNarc.parseArgs(CodeNarc.groovy:221)
at org.codenarc.CodeNarc.execute(CodeNarc.groovy:168)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.codehaus.groovy.runtime.callsite.PlainObjectMetaMethodSite.doInvoke(PlainObjectMetaMethodSite.java:43)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:193)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.call(PogoMetaMethodSite.java:73)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:139)
at org.codenarc.CodeNarc.main(CodeNarc.groovy:157)

===========================================================================

npm-groovy-lint error: Fatal error while calling CodeNarc
Reason: unknown
java.lang.AssertionError: Invalid argument format: [build]. Expression: matcher. Values: matcher = java.util.regex.Matcher[pattern=-(.)=(.) region=0,5 lastmatch=]
at org.codehaus.groovy.runtime.InvokerHelper.assertFailed(InvokerHelper.java:438)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.assertFailed(ScriptBytecodeAdapter.java:670)
at org.codenarc.CodeNarc$_parseArgs_closure3.doCall(CodeNarc.groovy:224)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:107)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:274)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1035)
at groovy.lang.Closure.call(Closure.java:412)
at groovy.lang.Closure.call(Closure.java:428)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2164)
at org.codehaus.groovy.runtime.dgm$197.invoke(Unknown Source)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:247)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:56)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:139)
at org.codenarc.CodeNarc.parseArgs(CodeNarc.groovy:221)
at org.codenarc.CodeNarc.execute(CodeNarc.groovy:168)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.codehaus.groovy.runtime.callsite.PlainObjectMetaMethodSite.doInvoke(PlainObjectMetaMethodSite.java:43)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:193)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.call(PogoMetaMethodSite.java:73)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:139)
at org.codenarc.CodeNarc.main(CodeNarc.groovy:157)

undefined
If you still have an error, post an issue to get help: https://github.com/nvuillam/vscode-groovy-lint/issues

Do you have any tips?

@french0u0
Copy link
Author

Sooo I've been struggling with this for an hour and after posting the issue I found the problem:
my groovy file contains whitespaces in the groovy script name.
When replacing the whitespaces by underscores it works.

Is this fixable? Or maybe give the user info in the little error pop up that whitespaces can be the issue?

@french0u0
Copy link
Author

Also, I haven't tested it with whitespaces in folder names but I can imagine this is also an issue...

@nvuillam
Copy link
Owner

nvuillam commented Jan 6, 2022

@french0u0 very good catch !
It shouldn't be an issue because before being linted, the file is copied in a temp directory

@nvuillam
Copy link
Owner

nvuillam commented Jan 6, 2022

@french0u0 please can you check with latest version 1.7.3 ? :)

@farshid3003
Copy link

I have the same problem when I have global variable like this:

#!/usr/bin/groovy
import groovy.io.FileType
@Grab('org.yaml:snakeyaml:1.17')

def recurrences = [
                'uk-office-hours',
                'nightly-scale-in',
                '24x7'
    ]

pipelineJob("quote-engine/asg-schedule-update") {
    displayName("ASG Schedule Update")


    parameters {
        stringParam('BRANCH', 'master', 'The git branch or revision to checkout.')
        choiceParam("ENVIRONMENT", environments,  'dev')
        choiceParam("RECURRENCE", recurrences,  '')
    }

    definition {
        cps {
            script(readFileFromWorkspace('jenkins/pipelines/asg-schedule-update.jenkinsfile'))
            sandbox()
        }
    }
}

If I move the variable inside the method, solves the problem.
Another issue is the format, which only works when I have an empty method. If you use my code and change the format, it will never fix it.

@nvuillam
Copy link
Owner

@french0u0 this is fixed in newest release v3.0.0, thanks to the great job of @stevenh :)

Please can you confirm it works well for your case now ?

@bbrueche
Copy link

I still see this happening in version v3.2.0
CodeNarcServer unexpected error:
{
"message": "Request failed with status code 500",
"name": "AxiosError",

@stevenh
Copy link
Collaborator

stevenh commented Jan 24, 2024

Can you share an example piece of code which triggers this error @bbrueche ?

@stevenh stevenh reopened this Jan 24, 2024
@alexanderbazhenoff
Copy link

alexanderbazhenoff commented Feb 8, 2024

Well guys, I got the same Axios error code in my working groovy jenkins pipeline, see full log of github actions run in (pastebin). I have also created a branch in my repo to reproduce this issue.

I have no spaces in files and also another way to define global variables is a type of ArrayList:

final BuiltinPipelineParameters = [
// ... contents here
as ArrayList

I did a lots of global variables in the head of code file before and everything worked fine in our GitLab CI with standalone Super Linter. But now...

The first question: @nvuillam Do you need another details? Is it a CodeNarc-related bug or npm-groovy-lint?

The second question is for me: now I need to add step by step all these 2000+ lines to watch where the fail... looks mad, but ok, I can post a details later.

stevenh added a commit to nvuillam/npm-groovy-lint that referenced this issue Feb 8, 2024
Fix java.lang.NoClassDefFoundError during parseFile resulting in
the request failing and causing 500 status codes.

We now catch Throwable instead of Exception as this is best effort
anyway.

Fixes: nvuillam/vscode-groovy-lint#137
@stevenh
Copy link
Collaborator

stevenh commented Feb 8, 2024

Thanks for the branch, have reproduced locally with just npm-groovy-lint on the command line.

It's failing on the parse check with: java.lang.NoClassDefFoundError: org/apache/ivy/util/MessageLogger presumably there's a missing class path.

This failure should be caught as its best effort but java.lang.NoClassDefFoundError is a subclass of Error not Exception so it's causing the CodeNarcServer request to fail.

PR in to fix upstream.

nvuillam pushed a commit to nvuillam/npm-groovy-lint that referenced this issue Feb 9, 2024
* fix: class not found request failure

Fix java.lang.NoClassDefFoundError during parseFile resulting in
the request failing and causing 500 status codes.

We now catch Throwable instead of Exception as this is best effort
anyway.

Fixes: nvuillam/vscode-groovy-lint#137

* fix: usage table in readme

Fix the usage table in the README by escaping pipe characters.
@nvuillam
Copy link
Owner

@stevenh many thanks for your reactivity :)

@alexanderbazhenoff I released a new version 3.2.1 , please can you confirm it is now ok ? :)

@alexanderbazhenoff
Copy link

alexanderbazhenoff commented Feb 13, 2024

@stevenh Thanks for fixing.

3.2.1 , please can you confirm it is now ok ? :)

@nvuillam Not sure, I use Intelij Idea :)

As I got failed on the line from my source:

@Grab(group = 'org.yaml', module = 'snakeyaml', version = '1.5')

Disabling the next line with // groovylint-disable-next-line didn't work here.

Can you please also add it to npm-groovy-lint? Hopefully this will be added soon to super-linter, or I need some time to read how to replace super-linter with single npm-groovy-lint in my repo.

@alexanderbazhenoff
Copy link

@nvuillam But, yeah, I have installed v3.2.1 extension in vscode and opened my source with default settings. No crashes or errors like this.

@stevenh
Copy link
Collaborator

stevenh commented Feb 13, 2024

Sounds like super-linter just needs updating if VS Code is working as expected, thanks for checking.

@nvuillam
Copy link
Owner

@alexanderbazhenoff you should have a look at MegaLinter, it's updated more often and is more performant :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants