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

StringIndexOutOfBoundsException in AbstractItem.getUrl #8481

Merged
merged 1 commit into from
Sep 20, 2023

Conversation

jglick
Copy link
Member

@jglick jglick commented Sep 11, 2023

Noticed numerous stack traces in a log file of the form

WARNING	h.ExpressionFactory2$JexlExpression#evaluate: Caught exception evaluating: item.task.url in /controllername/. Reason: java.lang.reflect.InvocationTargetException
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
	at java.base/java.lang.String.substring(String.java:1841)
	at hudson.model.AbstractItem.getUrl(AbstractItem.java:559)
	at hudson.model.AbstractItem.getUrl(AbstractItem.java:575)
	at hudson.model.Run.getUrl(Run.java:1055)
	at org.jenkinsci.plugins.workflow.support.steps.ExecutorStepExecution$PlaceholderTask.getUrl(ExecutorStepExecution.java:655)

Does not seem like it should be possible given Ancestor.getUrl Javadoc, but there it is. This whole block of logic from ea95434 is optional—we should not throw an exception if it does not work out.

@NotMyFault NotMyFault requested a review from a team September 12, 2023 10:46
Copy link
Member

@timja timja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/label ready-for-merge


This PR is now ready for merge, after ~24 hours, we will merge it if there's no negative feedback.

Thanks!

@comment-ops-bot comment-ops-bot bot added the ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback label Sep 12, 2023
@timja timja added the skip-changelog Should not be shown in the changelog label Sep 12, 2023
@NotMyFault NotMyFault merged commit 2a07b98 into jenkinsci:master Sep 20, 2023
15 checks passed
@jglick jglick deleted the AbstractItem.getUrl branch September 20, 2023 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback skip-changelog Should not be shown in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants