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

munitnyucontextmanager non helpful error reporting #30536

Closed
maxandersen opened this issue Jan 23, 2023 · 9 comments · Fixed by #30815
Closed

munitnyucontextmanager non helpful error reporting #30536

maxandersen opened this issue Jan 23, 2023 · 9 comments · Fixed by #30815

Comments

@maxandersen
Copy link
Member

maxandersen commented Jan 23, 2023

Describe the bug

I have an app which does not do much but besides starting up a javamail background thread and on every devmode restart I get this error:

2023-01-23 10:42:15,125 INFO  [io.quarkus] (Quarkus Main Thread) qilt stopped in 0.015s
java.util.ServiceConfigurationError: org.eclipse.microprofile.context.spi.ContextManagerExtension: io.smallrye.mutiny.context.MutinyContextManagerExtension not a subtype
	at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:589)
	at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1237)
	at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(ServiceLoader.java:1265)
	at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1300)
	at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1385)
	at java.base/java.lang.Iterable.forEach(Iterable.java:74)
	at io.smallrye.context.SmallRyeContextManager$Builder.discoverContextManagerExtensions(SmallRyeContextManager.java:318)
	at io.smallrye.context.SmallRyeContextManager$Builder.build(SmallRyeContextManager.java:335)
	at io.smallrye.context.SmallRyeContextManagerProvider.getContextManager(SmallRyeContextManagerProvider.java:48)
	at io.smallrye.context.SmallRyeContextManagerProvider.getContextManager(SmallRyeContextManagerProvider.java:37)
	at io.smallrye.context.SmallRyeContextManagerProvider.getContextManager(SmallRyeContextManagerProvider.java:11)
	at org.eclipse.microprofile.context.ManagedExecutor.builder(ManagedExecutor.java:128)
	at io.quarkus.smallrye.context.runtime.SmallRyeContextPropagationRecorder$4.get(SmallRyeContextPropagationRecorder.java:100)
	at org.eclipse.microprofile.context.ManagedExecutor_f18425d88d17864051ab3b7c3538397f8b96ea03_Synthetic_Bean.createSynthetic(Unknown Source)
	at org.eclipse.microprofile.context.ManagedExecutor_f18425d88d17864051ab3b7c3538397f8b96ea03_Synthetic_Bean.create(Unknown Source)
	at org.eclipse.microprofile.context.ManagedExecutor_f18425d88d17864051ab3b7c3538397f8b96ea03_Synthetic_Bean.create(Unknown Source)
	at io.quarkus.arc.impl.AbstractSharedContext.createInstanceHandle(AbstractSharedContext.java:113)
	at io.quarkus.arc.impl.AbstractSharedContext$1.get(AbstractSharedContext.java:37)
	at io.quarkus.arc.impl.AbstractSharedContext$1.get(AbstractSharedContext.java:34)
	at io.quarkus.arc.impl.LazyValue.get(LazyValue.java:26)
	at io.quarkus.arc.impl.ComputingCache.computeIfAbsent(ComputingCache.java:69)
	at io.quarkus.arc.impl.AbstractSharedContext.get(AbstractSharedContext.java:34)
	at io.quarkus.arc.impl.ClientProxies.getApplicationScopedDelegate(ClientProxies.java:21)
	at org.eclipse.microprofile.context.ManagedExecutor_f18425d88d17864051ab3b7c3538397f8b96ea03_Synthetic_ClientProxy.arc$delegate(Unknown Source)
	at org.eclipse.microprofile.context.ManagedExecutor_f18425d88d17864051ab3b7c3538397f8b96ea03_Synthetic_ClientProxy.toString(Unknown Source)
	at java.base/java.lang.String.valueOf(String.java:2951)
	at io.smallrye.config.common.utils.ConfigSourceUtil.propertiesToMap(ConfigSourceUtil.java:57)
	at io.smallrye.config.SysPropConfigSource.getSystemProperties(SysPropConfigSource.java:57)
	at io.smallrye.config.SysPropConfigSource.<init>(SysPropConfigSource.java:38)
	at io.smallrye.config.SmallRyeConfigBuilder.getDefaultSources(SmallRyeConfigBuilder.java:166)
	at io.smallrye.config.SmallRyeConfig$ConfigSources.buildSources(SmallRyeConfig.java:589)
	at io.smallrye.config.SmallRyeConfig$ConfigSources.<init>(SmallRyeConfig.java:542)
	at io.smallrye.config.SmallRyeConfig.<init>(SmallRyeConfig.java:68)
	at io.smallrye.config.SmallRyeConfigBuilder.build(SmallRyeConfigBuilder.java:532)
	at io.quarkus.runtime.configuration.QuarkusConfigFactory.getConfigFor(QuarkusConfigFactory.java:36)
	at io.smallrye.config.SmallRyeConfigProviderResolver.getConfig(SmallRyeConfigProviderResolver.java:76)
	at io.smallrye.config.SmallRyeConfigProviderResolver.getConfig(SmallRyeConfigProviderResolver.java:64)
	at org.eclipse.microprofile.config.ConfigProvider.getConfig(ConfigProvider.java:85)
	at io.quarkus.runtime.configuration.ConfigInstantiator.handleObject(ConfigInstantiator.java:56)
	at io.quarkus.runtime.logging.LoggingSetupRecorder.handleFailedStart(LoggingSetupRecorder.java:73)
	at io.quarkus.runtime.logging.LoggingSetupRecorder.handleFailedStart(LoggingSetupRecorder.java:68)
	at io.quarkus.deployment.dev.IsolatedDevModeMain.restartApp(IsolatedDevModeMain.java:233)
	at io.quarkus.deployment.dev.IsolatedDevModeMain.restartCallback(IsolatedDevModeMain.java:203)
	at io.quarkus.deployment.dev.RuntimeUpdatesProcessor.doScan(RuntimeUpdatesProcessor.java:537)
	at io.quarkus.deployment.console.ConsoleStateManager.forceRestart(ConsoleStateManager.java:141)
	at io.quarkus.deployment.console.ConsoleStateManager.lambda$installBuiltins$0(ConsoleStateManager.java:98)
	at io.quarkus.deployment.console.ConsoleStateManager$1.accept(ConsoleStateManager.java:73)
	at io.quarkus.deployment.console.ConsoleStateManager$1.accept(ConsoleStateManager.java:46)
	at io.quarkus.deployment.console.AeshConsole.lambda$setup$1(AeshConsole.java:275)
	at org.aesh.terminal.EventDecoder.accept(EventDecoder.java:118)
	at org.aesh.terminal.EventDecoder.accept(EventDecoder.java:31)
	at org.aesh.terminal.io.Decoder.write(Decoder.java:133)
	at org.aesh.readline.tty.terminal.TerminalConnection.openBlocking(TerminalConnection.java:216)
	at org.aesh.readline.tty.terminal.TerminalConnection.openBlocking(TerminalConnection.java:203)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)

I assume its because I have some system property set or some serviceloader in classpath that is messing it up but the error is not infomrative.

Expected behavior

would have expected the error to first not happen but if/when it does it should say what in particular it has an issue with.

"io.smallrye.mutiny.context.MutinyContextManagerExtension not a subtype" is not informative.

What is not a subtype or what? what key or config source is it failing on? just some hints would be nice.

Actual behavior

No response

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

@quarkus-bot
Copy link

quarkus-bot bot commented Jan 23, 2023

/cc @FroMage (context-propagation), @manovotn (context-propagation)

@maxandersen
Copy link
Member Author

maxandersen commented Jan 23, 2023

reproducer: https://github.com/maxandersen/qilt with commit sha https://github.com/maxandersen/qilt/commit/bdbc27e1174a2b681140f900195a0c7035d4c2e0

just run it with quarkus dev - it will complain about missing credentials; then force restart and error occurs.

@maxandersen
Copy link
Member Author

seems the root cause is that this get added to system properties:

 sprops.put("mail.event.scope", "session"); // or "application"
        sprops.put("mail.event.executor", es);
        sprops.put("mail.imaps.usesocketchannels", true);

easy to "fix" by updating Properties props = System.getProperties();to `Properties props = System.getProperties();'.

but this should not be necessary and at least why does quarkus boot fine but devmode restart fails?

@mkouba
Copy link
Contributor

mkouba commented Jan 23, 2023

easy to "fix" by updating Properties props = System.getProperties();to `Properties props = System.getProperties();'.

What's the difference?

@maxandersen
Copy link
Member Author

gah.

easy to "fix" by updating Properties props = System.getProperties();to `Properties props = new Properties();'.

sorry - too fast copy paste :)

@mkouba
Copy link
Contributor

mkouba commented Jan 23, 2023

sprops.put("mail.event.executor", es);

This is the problem, right? You basically leak the ManagedExecutor instance...

@maxandersen
Copy link
Member Author

@mkouba not saying it is great but why would it matter that the "es" is placed in system properties? why would that cause this weird error?

@mkouba
Copy link
Contributor

mkouba commented Jan 24, 2023

@mkouba not saying it is great but why would it matter that the "es" is placed in system properties? why would that cause this weird error?

Well, if you place a injected bean instance in the system properties then it survives the app restart/live reload, no?

And that's a recipe for class loading disaster...

@maxandersen
Copy link
Member Author

opened smallrye/smallrye-config#879 for the better error handling

@quarkus-bot quarkus-bot bot added this to the 3.0 - main milestone Feb 2, 2023
@gsmet gsmet modified the milestones: 3.0 - main, 2.16.2.Final Feb 7, 2023
benkard added a commit to benkard/mulkcms2 that referenced this issue Apr 2, 2023
This MR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [com.diffplug.spotless:spotless-maven-plugin](https://github.com/diffplug/spotless) | build | minor | `2.32.0` -> `2.33.0` |
| [io.quarkus:quarkus-maven-plugin](https://github.com/quarkusio/quarkus) | build | patch | `2.16.1.Final` -> `2.16.2.Final` |
| [io.quarkus:quarkus-universe-bom](https://github.com/quarkusio/quarkus-platform) | import | patch | `2.16.1.Final` -> `2.16.2.Final` |

---

### Release Notes

<details>
<summary>diffplug/spotless</summary>

### [`v2.33.0`](https://github.com/diffplug/spotless/blob/HEAD/CHANGES.md#&#8203;2330---2023-01-26)

##### Added

-   `ProcessRunner` has added some convenience methods so it can be used for maven testing. ([#&#8203;1496](diffplug/spotless#1496))
-   `ProcessRunner` allows to limit captured output to a certain number of bytes. ([#&#8203;1511](diffplug/spotless#1511))
-   `ProcessRunner` is now capable of handling long-running tasks where waiting for exit is delegated to the caller. ([#&#8203;1511](diffplug/spotless#1511))
-   Allow to specify node executable for node-based formatters using `nodeExecutable` parameter ([#&#8203;1500](diffplug/spotless#1500))

##### Fixed

-   The default list of type annotations used by `formatAnnotations` has had 8 more annotations from the Checker Framework added [#&#8203;1494](diffplug/spotless#1494)

##### Changes

-   **POTENTIALLY BREAKING** Bump minimum JRE from 8 to 11, next release likely to bump bytecode to Java 11 ([#&#8203;1514](diffplug/spotless#1514) part 1 of [#&#8203;1337](diffplug/spotless#1337))
-   Rename `YamlJacksonStep` into `JacksonYamlStep` while normalizing Jackson usage ([#&#8203;1492](diffplug/spotless#1492))
-   Convert `gson` integration to use a compile-only source set ([#&#8203;1510](diffplug/spotless#1510)).
-   \*\* POTENTIALLY BREAKING\*\* Removed support for KtLint 0.3x and 0.45.2 ([#&#8203;1475](diffplug/spotless#1475))
    -   `KtLint` does not maintain a stable API - before this MR, we supported every breaking change in the API since 2019.
    -   From now on, we will support no more than 2 breaking changes at a time.
-   NpmFormatterStepStateBase delays `npm install` call until the formatter is first used. This enables better integration
    with `gradle-node-plugin`. ([#&#8203;1522](diffplug/spotless#1522))
-   Bump default `ktlint` version to latest `0.48.1` -> `0.48.2` ([#&#8203;1529](diffplug/spotless#1529))
-   Bump default `scalafmt` version to latest `3.6.1` -> `3.7.1` ([#&#8203;1529](diffplug/spotless#1529))

</details>

<details>
<summary>quarkusio/quarkus</summary>

### [`v2.16.2.Final`](https://github.com/quarkusio/quarkus/releases/tag/2.16.2.Final)

[Compare Source](quarkusio/quarkus@2.16.1.Final...2.16.2.Final)

##### Complete changelog

-   [#&#8203;30976](quarkusio/quarkus#30976) - Metrics - check if index contains class before attempting to use it
-   [#&#8203;30965](quarkusio/quarkus#30965) - JandexBeanInfoAdapter.getMetricAnnotationsThroughStereotype is not null safe
-   [#&#8203;30959](quarkusio/quarkus#30959) - Return text from /q/metrics when the Accept header contains html
-   [#&#8203;30953](quarkusio/quarkus#30953) - Fix OIDC capability string
-   [#&#8203;30947](quarkusio/quarkus#30947) - Ignore interface/class without default constructs fields in SB config
-   [#&#8203;30940](quarkusio/quarkus#30940) - Use SchemaType.ARRAY instead of "ARRAY" for native support
-   [#&#8203;30919](quarkusio/quarkus#30919) - Compilation to native fails, when quarkus-smallrye-openapi is included
-   [#&#8203;30916](quarkusio/quarkus#30916) - Add AppCDS documentation
-   [#&#8203;30896](quarkusio/quarkus#30896) - Quarkus spring-boot-properties extension unable to handle complex configuration.
-   [#&#8203;30878](quarkusio/quarkus#30878) - Bump postgresql from 42.5.2 to 42.5.3
-   [#&#8203;30866](quarkusio/quarkus#30866) - Only run the quickstart compilation for main
-   [#&#8203;30851](quarkusio/quarkus#30851) - Fixed return type typo in smallrye graphQL guide
-   [#&#8203;30844](quarkusio/quarkus#30844) - Fixed greeting in getting started guide
-   [#&#8203;30839](quarkusio/quarkus#30839) - Fix handling of Accept header in graphQL
-   [#&#8203;30833](quarkusio/quarkus#30833) - Update docs to show BuildProducer use as method parameter instead of field
-   [#&#8203;30828](quarkusio/quarkus#30828) - Make OIDC session cookie same site lax by default
-   [#&#8203;30826](quarkusio/quarkus#30826) - Caffeine - Automatically register metrics cache impls if Micrometer is around
-   [#&#8203;30825](quarkusio/quarkus#30825) - Fix comment about Caffeine optimization
-   [#&#8203;30823](quarkusio/quarkus#30823) - Change accept header to valid plain text in micrometer documentation
-   [#&#8203;30821](quarkusio/quarkus#30821) - Packaging type -Dquarkus.package.create-appcds=true isn't documented
-   [#&#8203;30815](quarkusio/quarkus#30815) - Update SmallRye Config to 2.13.2
-   [#&#8203;30812](quarkusio/quarkus#30812) - Manage the apache-mime4j dependency
-   [#&#8203;30806](quarkusio/quarkus#30806) - */* in Accept header is ignored if not listed as the first item
-   [#&#8203;30805](quarkusio/quarkus#30805) - MailTemplateInstance with attachments
-   [#&#8203;30803](quarkusio/quarkus#30803) - Support file and byte array attachments in `MailTemplateInstance`
-   [#&#8203;30797](quarkusio/quarkus#30797) - OIDC login not work
-   [#&#8203;30783](quarkusio/quarkus#30783) - <artifactId> uses 'quarkus.platform.artifact-id' property
-   [#&#8203;30778](quarkusio/quarkus#30778) - Avoid creating 3 Liquibase MongoDB instances for startup operations
-   [#&#8203;30776](quarkusio/quarkus#30776) - Ensure that AwsProxyRequestContext can be used with [@&#8203;Context](https://github.com/Context) in RESTEasy Reactive
-   [#&#8203;30767](quarkusio/quarkus#30767) - Remove duplicate notification of SseBroadcaster's onErrorListeners
-   [#&#8203;30765](quarkusio/quarkus#30765) - Bump postgresql from 42.5.1 to 42.5.2
-   [#&#8203;30755](quarkusio/quarkus#30755) - Update ForwardedParser to validate the port
-   [#&#8203;30744](quarkusio/quarkus#30744) - \[Quarkus Native] ClassNotFoundException: com.github.benmanes.caffeine.cache.SSSW
-   [#&#8203;30536](quarkusio/quarkus#30536) - munitnyucontextmanager non helpful error reporting
-   [#&#8203;29753](quarkusio/quarkus#29753) - Introduce ConnectionFactoryWrapperBuildItem
-   [#&#8203;29605](quarkusio/quarkus#29605) - Update docs to reflect that injection should not
-   [#&#8203;27774](quarkusio/quarkus#27774) - PLANNER-1709 Avoid deprecated penalize/reward overloads
-   [#&#8203;23442](quarkusio/quarkus#23442) - problem using quarkus-resteasy-reactive-kotlin-serialization with AwsProxyRequestContext

</details>

<details>
<summary>quarkusio/quarkus-platform</summary>

### [`v2.16.2.Final`](quarkusio/quarkus-platform@2.16.1.Final...2.16.2.Final)

[Compare Source](quarkusio/quarkus-platform@2.16.1.Final...2.16.2.Final)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox.

👻 **Immortal**: This MR will be recreated if closed unmerged. Get [config help](https://github.com/renovatebot/renovate/discussions) if that's undesired.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4yNC4wIiwidXBkYXRlZEluVmVyIjoiMzQuMjQuMCJ9-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants