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

Sharing a Stream Scoped Entity fails with error #17882

Closed
ryan-carroll-graylog opened this issue Jan 9, 2024 · 2 comments · Fixed by #17891
Closed

Sharing a Stream Scoped Entity fails with error #17882

ryan-carroll-graylog opened this issue Jan 9, 2024 · 2 comments · Fixed by #17891
Labels

Comments

@ryan-carroll-graylog
Copy link
Contributor

Ateempting to share a Stream Scoped Entity results in an errror: java.lang.IllegalArgumentException: type <stream_title> does not exist

When sharing an entity there is are checks for any dependent entities in order to warn users that they may need to share the dependencies as well. E.x. if an Event Definition scoped to a Stream is shared, the Stream should be shared as well.

The dependency checking logic is shared with Content Packs, which was updated to support Stream title references in Content Packs. Some updates need to made to the Entity Sharing code to handle these changes.

Workaround

  1. Remove any Streams from entity that needs to be shared
  2. Share the entity (and dependent Stream)
  3. Add Stream back to entity

Expected Behavior

Users are able to share Steam Scoped entities.

Current Behavior

Sharing a Steam Scoped entity results in the error:

java.lang.IllegalArgumentException: type <stream_title> does not exist
	at org.graylog.grn.GRNRegistry.lambda$newGRNBuilder$0(GRNRegistry.java:138) ~[classes/:?]
	at java.base/java.util.Optional.orElseThrow(Optional.java:403) ~[?:?]
	at org.graylog.grn.GRNRegistry.newGRNBuilder(GRNRegistry.java:138) ~[classes/:?]
	at org.graylog.grn.GRNRegistry.newGRN(GRNRegistry.java:100) ~[classes/:?]
	at org.graylog.security.entities.EntityDependencyResolver.lambda$resolve$3(EntityDependencyResolver.java:88) ~[classes/:?]
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) ~[?:?]
	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179) ~[?:?]
	at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133) ~[?:?]
	at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1845) ~[?:?]
	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 org.graylog.security.entities.EntityDependencyResolver.resolve(EntityDependencyResolver.java:90) ~[classes/:?]
	at org.graylog.security.shares.EntitySharesService.checkMissingPermissionsOnDependencies(EntitySharesService.java:307) ~[classes/:?]
	at org.graylog.security.shares.EntitySharesService.prepareShare(EntitySharesService.java:110) ~[classes/:?]
	at org.graylog.security.rest.EntitySharesResource.prepareShare(EntitySharesResource.java:124) ~[classes/:?]
	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) ~[?:?]

Possible Solution

Add the new stream_title type to the GRNRegistry.

Steps to Reproduce (for bugs)

  1. Create a Stream Scoped Event Definition
  2. Click Share for the Event Definition
  3. See error

Context

Your Environment

  • Graylog Version: 5.1, 5.2, 6.0
  • Java Version:
  • OpenSearch Version:
  • MongoDB Version:
  • Operating System:
  • Browser version:
@theherodied
Copy link

Noticed this issue after updating to 5.2.3 today.

@coffee-squirrel
Copy link

coffee-squirrel commented Jan 12, 2024

We noticed this under 5.2.3, as well. 5.2.2 appears to be fine.

It seems omitting Streams on the event definitions allows us to proceed with sharing, so we'll just do that as a workaround until the fix lands.

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

Successfully merging a pull request may close this issue.

3 participants