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

Marker property value is too long #1269

Closed
henols opened this issue Aug 4, 2023 · 9 comments
Closed

Marker property value is too long #1269

henols opened this issue Aug 4, 2023 · 9 comments

Comments

@henols
Copy link

henols commented Aug 4, 2023

Im trying to refresh a quite big Gradle project and it wont build properly since I get this entry in the Error Log.

**eclipse.buildId=4.28.0.20230608-1200
java.version=17.0.8
java.vendor=Eclipse Adoptium
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments: -product org.eclipse.epp.package.java.product
Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product

org.eclipse.core.resources
Error
Fri Aug 04 16:21:17 CEST 2023
Problems occurred when invoking code from plug-in: "org.eclipse.core.resources".

org.eclipse.core.runtime.AssertionFailedException: assertion failed: Marker property value is too long: One or more cycles were detected in the build path of project 'ai-application-eclipseclient-test'. The paths towards the cycle and cycle are:
ai-application-eclipseclient-test->{rest-dependencyanalysis, rest-wuirenderdocument}
ai-application-eclipseclient-test->{rest-dependencyanalysis, rest-wuirenderdocument, developmentmodule-manager-impl}
ai-application-eclipseclient-test, rest-dependencyanalysis->{rest-wuirenderdocument, developmentmodule-manager-impl}
ai-application-eclipseclient-test->{rest-dependencyanalysis, rest-wuirenderdocument, developmentmodule-manager-impl, xmlimport}
ai-application-eclipseclient-test, rest-dependencyanalysis->{rest-wuirenderdocument, developmentmodule-manager-impl, xmlimport}
ai-application-eclipseclient-test, rest-dependencyanalysis, rest-wuirenderdocument->{developmentmodule-manager-impl, xmlimport}
ai-application-eclipseclient-test->{rest-dependencyanalysis, rest-wuirenderdocument, developmentmodule-manager-impl, xmlimport, variantcodeproposer-impl, knockdown-rule-loader}
ai-application-eclipseclient-test, rest-dependencyanalysis->{rest-wuirenderdocument, developmentmodule-manager-impl, xmlimport, variantcodeproposer-impl, knockdown-rule-loader}
ai-application-eclipseclient-test, rest-dependencyanalysis, rest-wuirenderdocument->{developmentmodule-manager-impl, xmlimport, variantcodeproposer-impl, knockdown-rule-loader}
ai-application-eclipseclient-test, rest-dependencyanalysis, rest-wuirenderdocument, developmentmodule-manager-impl->{xmlimport, variantcodeproposer-impl, knockdown-rule-loader}
ai-application-eclipseclient-test, rest-dependencyanalysis, rest-wuirenderdocument, developmentmodule-manager-impl, xmlimport->{variantcodeproposer-impl, knockdown-rule-loader}
ai-application-eclipseclient-test->{rest-dependencyanalysis, rest-wuirenderdocument, developmentmodule-manager-impl, xmlimport, variantcodeproposer-impl, knockdown-rule-loader, rest-primeprocessors, integration-common}
ai-application-eclipseclient-test, rest-dependencyanalysis->{rest-wuirenderdocument, developmentmodule-manager-impl, xmlimport, variantcodeproposer-impl, knockdown-rule-loader, rest-primeprocessors, integration-common}
ai-application-eclipseclient-test, rest-dependencyanalysis, rest-wuirenderdocument->{developmentmodule-manager-impl, xmlimport, variantcodeproposer-impl, knockdown-rule-loader, rest-primeprocessors, integration-common}
ai-application-eclipseclient-test, rest-dependencyanalysis, rest-wuirenderdocument, developmentmodule-manager-impl->{xmlimport, variantcodeproposer-impl, knockdown-rule-loader, rest-primeprocessors, integration-common}
ai-application-eclipseclient-test, rest-dependencyanalysis, rest-wuirenderdocument, developmentmodule-manager-impl, xmlimport->{variantcodeproposer-impl, knockdown-rule-loader, rest-primeprocessors, integration-common}
ai-application-eclipseclient-test, rest-dependencyanalysis, rest-wuirenderdocument, developmentmodule-manager-impl, xmlimport, variantcodeproposer-impl, knockdown-rule-loader->{rest-primeprocessors, integration-common}
ai-application-eclipseclient-test, rest-dependencyanalysis, rest-wuirenderdocument, developmentmodule-manager-impl, xmlimport, variantcodeproposer-impl->{knockdown-rule-loader, rest-primeprocessors, integration-common, confirming-info-operations}
ai-application-eclipseclient-test, rest-dependencyanalysis, rest-wuirenderdocument, developmentmodule-manager-impl, xmlimport, variantcodeproposer-impl, knockdown-rule-loader, rest-primeprocessors, integration-common->{confirming-info-operations, valueproposer-impl}
ai-application-eclipseclient-test, rest-dependencyanalysis, rest-wuirenderdocument, developmentmodule-manager-impl, xmlimport, variantcodeproposer-impl->{knockdown-rule-loader, rest-primeprocessors, integration-common, confirming-info-operations, valueproposer-impl, eco-application}
ai-application-eclipseclient-test, rest-dependencyanalysis, rest-wuirenderdocument, developmentmodule-manager-impl, xmlimport, variantcodeproposer-impl, knockdown-rule-loader, rest-primeprocessors, integration-common, confirming-info-operations->{valueproposer-impl, eco-application}
ai-application-eclipseclient-test->{rest-dependencyanalysis, rest-wuirenderdocument, developmentmodule-manager-impl, xmlimport, variantcodeproposer-impl, knockdown-rule-loader, rest-primeprocessors, integration-common, confirming-info-operations, valueproposer-impl, eco-application, server-plugins}
ai-application-eclipseclient-test, rest-dependencyanalysis->{rest-wuirenderdocument, developmentmodule-manager-impl, xmlimport, variantcodeproposer-impl, knockdown-rule-loader, rest-primeprocessors, integration-common, confirming-info-operations, valueproposer-impl, eco-application, server-plugins}
ai-application-eclipseclient-test, rest-dependencyanalysis, rest-wuirenderdocument->{developmentmodule-manager-impl, xmlimport, variantcodeproposer-impl, knockdown-rule-loader, rest-primeprocessors, integration-common, confirming-info-operations, valueproposer-impl, eco-application, server-plugins}
ai-application-eclipseclient-test, rest-dependencyanalysis, rest-wuirenderdocument, developmentmodule-manager-impl->{xmlimport, variantcodeproposer-impl, knockdown-rule-loader, rest-primeprocessors, integration-common, confirming-info-operations, valueproposer-impl, eco-application, server-plugins}
ai-application-eclipseclient-test, rest-dependencyanalysis, rest-wuirenderdocument, developmentmodule-manager-impl, xmlimport->{variantcodeproposer-impl, knockdown-rule-loader, rest-primeprocessors, integration-common, confirming-info-operations, valueproposer-impl, eco-application, server-plugins}
ai-application-eclipseclient-test, rest-dependencyanalysis, rest-wuirenderdocument, developmentmodule-manager-impl, xmlimport, variantcodeproposer-impl, knockdown-rule-loader->{rest-primeprocessors, integration-common, confirming-info-operations, valueproposer-impl, eco-application, server-plugins}
ai-application-eclipseclient-test, rest-dependencyanalysis, rest-wuirenderdocument, developmentmodule-manager-impl, xmlimport, variantcodeproposer-impl, knockdown-rule-loader, rest-primeprocessors, integration-common->{confirming-info-operations, valueproposer-impl, eco-application, server-plugins}
ai-application-eclipseclient-test, rest-dependencyanalysis, rest-wuirenderdocument, developmentmodule-manager-impl, xmlimport, variantcodeproposer-impl, knockdown-rule-loader, rest-primeprocessors, integration-common, confirming-info-operations, valueproposer-impl->{eco-application, server-plugins}
ai-application-eclipseclient-test->{rest-dependencyanalysis, rest-wuirenderdocument, developmentmodule-manager-impl, xmlimport, variantcodeproposer-impl, knockdown-rule-loader, rest-primeprocessors, integration-common, confirming-info-operations, valueproposer-impl, eco-application, server-plugins, result-cursor-impl}
ai-application-eclipseclient-test, rest-dependencyanalysis->{rest-wuirenderdocument, developmentmodule-manager-impl, xmlimport, variantcodeproposer-impl, knockdown-rule-loader, rest-primeprocessors, integration-common, confirming-info-operations, valueproposer-impl, eco-application, server-plugins, result-cursor-impl}
ai-application-eclipseclient-test, rest-dependencyanalysis, rest-wuirenderdocument->{developmentmodule-manager-impl, xmlimport, variantcodeproposer-impl, knockdown-rule-loader, rest-primeprocessors, integration-common, confirming-info-operations, valueproposer-impl, eco-application, server-plugins, result-cursor-impl}
ai-application-eclipseclient-test, rest-dependencyanalysis, rest-wuirenderdocument, developmentmodule-manager-impl->{xmlimport, variantcodeproposer-impl, knockdown-rule-loader, rest-primeprocessors, integration-common, confirming-info-operations, valueproposer-impl, eco-application, server-plugins, result-cursor-impl}
ai-application-eclipseclient-test, rest-dependencyanalysis, rest-wuirenderdocument, developmentmodule-manager-impl, xmlimport->{variantcodeproposer-impl, knockdown-rule-loader, rest-primeprocessors, integration-common, confirming-info-operations, valueproposer-impl, eco-application, server-plugins, result-cursor-impl}
ai-application-eclipseclient-test, rest-dependencyanalysis, rest-wuirenderdocument, developmentmodule-manager-impl, xmlimport, variantcodeproposer-impl, knockdown-rule-loader->{rest-primeprocessors, integration-common, confirming-info-operations, valueproposer-impl, eco-application, server-plugins, result-cursor-impl}
ai-application-eclipseclient-test, rest-dependencyanalysis, rest-wuirenderdocument, developmentmodule-manager-impl, xmlimport, variantcodeproposer-impl, knockdown-rule-loader, rest-primeprocessors, integration-common->{confirming-info-operations, valueproposer-impl, eco-application, server-plugins, result-cursor-impl}
ai-application-eclipseclient-test, rest-dependencyanalysis, rest-wuirenderdocument, developmentmodule-manager-impl, xmlimport, variantcodeproposer-impl, knockdown-rule-loader, rest-primeprocessors, integration-common, confirming-info-operations, valueproposer-impl->{eco-application, server-plugins, result-cursor-impl}
ai-application-eclipseclient-test, rest-dependencyanalysis, rest-wuirenderdocument, developmentmodule-manager-impl, xmlimport, variantcodeproposer-impl, knockdown-rule-loader, rest-primeprocessors, integration-common, confirming-info-operations, valueproposer-impl->{eco-application, server-plugins, result-cursor-impl, prototypeindividual-manager-api}
ai-application-eclipseclient-test->{rest-dependencyanalysis, rest-wuirenderdocument, developmentmodule-manager-impl, xmlimport, variantcodeproposer-impl, knockdown-rule-loader, rest-primeprocessors, integration-common, confirming-info-operations, valueproposer-impl, eco-application, server-plugins, result-cursor-impl, service-executor-manager-ejb}
ai-application-eclipseclient-test, rest-dependencyanalysis->{rest-wuirenderdocument, developmentmodule-manager-impl, xmlimport, variantcodeproposer-impl, knockdown-rule-loader, rest-primeprocessors, integration-
at org.eclipse.core.runtime.Assert.isTrue(Assert.java:113)
at org.eclipse.core.internal.resources.MarkerInfo.checkValidAttribute(MarkerInfo.java:59)
at org.eclipse.core.internal.resources.MarkerAttributeMap.putAll(MarkerAttributeMap.java:110)
at org.eclipse.core.internal.resources.MarkerAttributeMap.lambda$0(MarkerAttributeMap.java:96)
at java.base/java.util.concurrent.atomic.AtomicReference.getAndUpdate(AtomicReference.java:188)
at org.eclipse.core.internal.resources.MarkerAttributeMap.putAll(MarkerAttributeMap.java:94)
at org.eclipse.core.internal.resources.MarkerInfo.addAttributes(MarkerInfo.java:170)
at org.eclipse.core.internal.resources.Marker.setAttributes(Marker.java:306)
at org.eclipse.jdt.internal.core.JavaProject.createClasspathProblemMarker(JavaProject.java:1265)
at org.eclipse.jdt.internal.core.JavaProject.validateCycles(JavaProject.java:491)
at org.eclipse.jdt.internal.core.DeltaProcessor.resourceChanged(DeltaProcessor.java:2215)
at org.eclipse.jdt.internal.core.DeltaProcessingState.resourceChanged(DeltaProcessingState.java:501)
at org.eclipse.core.internal.events.NotificationManager$1.run(NotificationManager.java:307)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:297)
at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:160)
at org.eclipse.core.internal.resources.Workspace.broadcastBuildEvent(Workspace.java:374)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:191)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:289)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

**

@jukzi
Copy link
Contributor

jukzi commented Aug 11, 2023

The maximum marker size is 65535. However you should fix the root cause of cyclic dependency anyway:
One or more cycles were detected in the build path of project 'ai-application-eclipseclient-test

@jukzi jukzi closed this as completed Aug 11, 2023
@iloveeclipse
Copy link
Member

@jukzi : surely the problem can be fixed by user, but what should user do if we are unable to report the problem and break the build (which would most likely just continue to build other stuff).

@iloveeclipse iloveeclipse reopened this Aug 11, 2023
@jukzi
Copy link
Contributor

jukzi commented Sep 7, 2023

such an error is also logged when running org.eclipse.jdt.core.tests.model.JavaSearchScopeTests

@jukzi
Copy link
Contributor

jukzi commented Sep 7, 2023

A possible solution for jdt:

diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaProject.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaProject.java
index 8db6515..3f50a3b 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaProject.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaProject.java
@@ -1261,6 +1261,7 @@
 
 		try {
 			marker = this.project.createMarker(IJavaModelMarker.BUILDPATH_PROBLEM_MARKER);
+			String message = status.getMessage();
 			marker.setAttributes(
 				new String[] {
 					IMarker.MESSAGE,
@@ -1275,7 +1276,7 @@
 					IMarker.SOURCE_ID,
 				},
 				new Object[] {
-					status.getMessage(),
+					message.substring(0, Math.min(message.length(), 65535)),
 					Integer.valueOf(severity),
 					Messages.classpath_buildPath,
 					isCycleProblem ? "true" : "false",//$NON-NLS-1$ //$NON-NLS-2$

@szarnekow
Copy link
Contributor

  • 			message.substring(0, Math.min(message.length(), 65535)),
    

It's the bytes that are relevant, not the char length. See org.eclipse.core.internal.resources.MarkerInfo.checkValidAttribute(Object)

@henols
Copy link
Author

henols commented Sep 27, 2023

@jukzi If you are still on it I think this will do the trick.

        ByteBuffer buff = ByteBuffer.allocate(65535);
        encoder.encode(CharBuffer.wrap(status.getMessage()), buff, true);
        marker.setAttributes(
            new String[] {
                IMarker.MESSAGE,
                IMarker.SEVERITY,
                IMarker.LOCATION,
                IJavaModelMarker.CYCLE_DETECTED,
                IJavaModelMarker.CLASSPATH_FILE_FORMAT,
                IJavaModelMarker.OUTPUT_OVERLAPPING_SOURCE,
                IJavaModelMarker.ID,
                IJavaModelMarker.ARGUMENTS ,
                IJavaModelMarker.CATEGORY_ID,
                IMarker.SOURCE_ID,
            },
            new Object[] {
                new String(buff.array(), 0, buff.position(), StandardCharsets.UTF_8),
                Integer.valueOf(severity),
                Messages.classpath_buildPath,
                isCycleProblem ? "true" : "false",//$NON-NLS-1$ //$NON-NLS-2$
                isClasspathFileFormatProblem ? "true" : "false",//$NON-NLS-1$ //$NON-NLS-2$
                isOutputOverlapping ? "true" : "false", //$NON-NLS-1$ //$NON-NLS-2$
                Integer.valueOf(status.getCode()),
                Util.getProblemArgumentsForMarker(arguments) ,
                Integer.valueOf(CategorizedProblem.CAT_BUILDPATH),
                JavaBuilder.SOURCE_ID,
            }
        );

@jukzi
Copy link
Contributor

jukzi commented Sep 28, 2023

@henols can you create a PR please?

in your solution i think it's overkill to always allocate ByteBuffer.allocate(65535).
allocate min(message length,655535) at max.

@henols
Copy link
Author

henols commented Sep 28, 2023 via email

@jukzi
Copy link
Contributor

jukzi commented Sep 28, 2023

henols added a commit to henols/eclipse.jdt.core that referenced this issue Oct 16, 2023
jukzi added a commit to jukzi/eclipse.jdt.core that referenced this issue Dec 20, 2024
tested by JavaSearchScopeTests.testBug250211

eclipse-jdt#1269
@jukzi jukzi closed this as completed in 744717d Dec 20, 2024
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

No branches or pull requests

4 participants