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

Invalid metadata could have.. a far more helpful failure #368

Open
Ampflower opened this issue Sep 22, 2023 · 4 comments
Open

Invalid metadata could have.. a far more helpful failure #368

Ampflower opened this issue Sep 22, 2023 · 4 comments

Comments

@Ampflower
Copy link
Contributor

Expected

At minimum, tell where it is failing and from which mod or path if possible.

Most helpful would be dumping the failing object.

Actual

This doesn't really tell me what went wrong where; at most, an invalid version specifier?:

java.lang.ClassCastException: Cannot coerce loader value to a String
	at org.quiltmc.loader.impl.metadata.qmj.JsonLoaderValue.asString(JsonLoaderValue.java:134)
	at org.quiltmc.loader.impl.metadata.qmj.V1ModMetadataReader.readVersionSpecifier(V1ModMetadataReader.java:725)
	at org.quiltmc.loader.impl.metadata.qmj.V1ModMetadataReader.readDependencyObject(V1ModMetadataReader.java:680)
	at org.quiltmc.loader.impl.metadata.qmj.V1ModMetadataReader.readFields(V1ModMetadataReader.java:196)
	at org.quiltmc.loader.impl.metadata.qmj.V1ModMetadataReader.read(V1ModMetadataReader.java:70)
	at org.quiltmc.loader.impl.metadata.qmj.ModMetadataReader.read(ModMetadataReader.java:93)
	at org.quiltmc.loader.impl.metadata.qmj.ModMetadataReader.read(ModMetadataReader.java:47)
	at org.quiltmc.loader.impl.plugin.quilt.StandardQuiltPlugin.scan0(StandardQuiltPlugin.java:195)
	at org.quiltmc.loader.impl.plugin.quilt.StandardQuiltPlugin.scanFolder(StandardQuiltPlugin.java:183)
	at org.quiltmc.loader.impl.plugin.QuiltPluginManagerImpl.scanFolderAsMod(QuiltPluginManagerImpl.java:1668)
	at org.quiltmc.loader.impl.plugin.QuiltPluginManagerImpl.scanModFile0(QuiltPluginManagerImpl.java:1750)
	at org.quiltmc.loader.impl.plugin.QuiltPluginManagerImpl.scanModFile(QuiltPluginManagerImpl.java:1716)
	at org.quiltmc.loader.impl.plugin.QuiltPluginManagerImpl.lambda$scanClasspath$9(QuiltPluginManagerImpl.java:1087)
	at org.quiltmc.loader.impl.discovery.ClasspathModCandidateFinder.findCandidatesStatic(ClasspathModCandidateFinder.java:71)
	at org.quiltmc.loader.impl.plugin.QuiltPluginManagerImpl.scanClasspath(QuiltPluginManagerImpl.java:1073)
	at org.quiltmc.loader.impl.plugin.QuiltPluginManagerImpl.runInternal(QuiltPluginManagerImpl.java:1049)
	at org.quiltmc.loader.impl.plugin.QuiltPluginManagerImpl.run(QuiltPluginManagerImpl.java:515)
	at org.quiltmc.loader.impl.QuiltLoaderImpl.runPlugins(QuiltLoaderImpl.java:490)
	at org.quiltmc.loader.impl.QuiltLoaderImpl.setup(QuiltLoaderImpl.java:271)
	at org.quiltmc.loader.impl.QuiltLoaderImpl.load(QuiltLoaderImpl.java:263)
	at org.quiltmc.loader.impl.launch.knot.Knot.init(Knot.java:147)
	at org.quiltmc.loader.impl.launch.knot.Knot.launch(Knot.java:76)
	at org.quiltmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:28)
	at net.fabricmc.devlaunchinjector.Main.main(Main.java:86)
@AlexIIL
Copy link
Contributor

AlexIIL commented Sep 22, 2023

Full crash log please. In particular I'd like to know which version of quilt loader you're using, since I think this was fixed in a newer version of quilt-loader?

@Ampflower
Copy link
Contributor Author

Crash
---- Quilt Loader: Critial Error Report ----
Date/Time: 2023/09/22 16:10:52.8161

-- Error 1 --

Unhandled Throwable!

java.lang.ClassCastException: Cannot coerce loader value to a String
	at org.quiltmc.loader.impl.metadata.qmj.JsonLoaderValue.asString(JsonLoaderValue.java:134)
	at org.quiltmc.loader.impl.metadata.qmj.V1ModMetadataReader.readVersionSpecifier(V1ModMetadataReader.java:725)
	at org.quiltmc.loader.impl.metadata.qmj.V1ModMetadataReader.readDependencyObject(V1ModMetadataReader.java:680)
	at org.quiltmc.loader.impl.metadata.qmj.V1ModMetadataReader.readFields(V1ModMetadataReader.java:196)
	at org.quiltmc.loader.impl.metadata.qmj.V1ModMetadataReader.read(V1ModMetadataReader.java:70)
	at org.quiltmc.loader.impl.metadata.qmj.ModMetadataReader.read(ModMetadataReader.java:93)
	at org.quiltmc.loader.impl.metadata.qmj.ModMetadataReader.read(ModMetadataReader.java:47)
	at org.quiltmc.loader.impl.plugin.quilt.StandardQuiltPlugin.scan0(StandardQuiltPlugin.java:195)
	at org.quiltmc.loader.impl.plugin.quilt.StandardQuiltPlugin.scanFolder(StandardQuiltPlugin.java:183)
	at org.quiltmc.loader.impl.plugin.QuiltPluginManagerImpl.scanFolderAsMod(QuiltPluginManagerImpl.java:1668)
	at org.quiltmc.loader.impl.plugin.QuiltPluginManagerImpl.scanModFile0(QuiltPluginManagerImpl.java:1750)
	at org.quiltmc.loader.impl.plugin.QuiltPluginManagerImpl.scanModFile(QuiltPluginManagerImpl.java:1716)
	at org.quiltmc.loader.impl.plugin.QuiltPluginManagerImpl.lambda$scanClasspath$9(QuiltPluginManagerImpl.java:1087)
	at org.quiltmc.loader.impl.discovery.ClasspathModCandidateFinder.findCandidatesStatic(ClasspathModCandidateFinder.java:71)
	at org.quiltmc.loader.impl.plugin.QuiltPluginManagerImpl.scanClasspath(QuiltPluginManagerImpl.java:1073)
	at org.quiltmc.loader.impl.plugin.QuiltPluginManagerImpl.runInternal(QuiltPluginManagerImpl.java:1049)
	at org.quiltmc.loader.impl.plugin.QuiltPluginManagerImpl.run(QuiltPluginManagerImpl.java:515)
	at org.quiltmc.loader.impl.QuiltLoaderImpl.runPlugins(QuiltLoaderImpl.java:490)
	at org.quiltmc.loader.impl.QuiltLoaderImpl.setup(QuiltLoaderImpl.java:271)
	at org.quiltmc.loader.impl.QuiltLoaderImpl.load(QuiltLoaderImpl.java:263)
	at org.quiltmc.loader.impl.launch.knot.Knot.init(Knot.java:147)
	at org.quiltmc.loader.impl.launch.knot.Knot.launch(Knot.java:76)
	at org.quiltmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:28)
	at net.fabricmc.devlaunchinjector.Main.main(Main.java:86)


-- Plugin State --

Loaded Plugins (2):
 - 'quilt_loader' (Builtin)
 - 'quilted_fabric_loader' (Builtin)




-- Mod Table --

| Mod                      | ID         | Version  | Plugin        | File(s)                                                                                                                                                                                                                                                  |
|--------------------------|------------|----------|---------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Minecraft                | minecraft  | 1.20.2   | quilt_loader  | <user>/IdeaProjects/music-moods/.gradle/quilt-loom-cache/minecraftMaven/net/minecraft/minecraft-merged-project-root/1.20.2-loom.mappings.1_20_2.layered+hash.2198-v2/minecraft-merged-project-root-1.20.2-loom.mappings.1_20_2.layered+hash.2198-v2.jar  |
| OpenJDK 64-Bit Server VM | java       | 17       | quilt_loader  | <user>/.jdks/graalvm-ce-java17-22.2.0                                                                                                                                                                                                                    |
|--------------------------|------------|----------|---------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|


-- Mod Details --

<user>/.jdks/graalvm-ce-java17-22.2.0:
###########################################
#  Loaded by  'quilt_loader'              #
#  Name     = 'OpenJDK 64-Bit Server VM'  #
#  ID       = 'java'                      #
#  Version  = '17'                        #
#  LoadType = IF_REQUIRED                 #
###########################################

<user>/IdeaProjects/music-moods/.gradle/quilt-loom-cache/minecraftMaven/net/minecraft/minecraft-merged-project-root/1.20.2-loom.mappings.1_20_2.layered+hash.2198-v2/minecraft-merged-project-root-1.20.2-loom.mappings.1_20_2.layered+hash.2198-v2.jar:
###############################
#  Loaded by  'quilt_loader'  #
#  Name     = 'Minecraft'     #
#  ID       = 'minecraft'     #
#  Version  = '1.20.2'        #
#  LoadType = IF_REQUIRED     #
#  Depends on 'java' [17, ∞)  #
###############################



---- end of report ----
QMJ
{
	"schema_version": 1,
	"quilt_loader": {
		"group": "gay.ampflower",
		"id": "music-moods",
		"version": "${version}",
		"metadata": {
			"name": "Music Moods",
			"description": "Configure how music & sound are handled.",
			"contributors": {
				"Ampflower": "Owner"
			},
			"contact": {
				"homepage": "https://modrinth.com/mod/music-moods",
				"sources": "https://github.com/the-glitch-network/music-moods",
				"issues": "https://github.com/the-glitch-network/music-moods/issues"
			},
			"license": "MPL-2.0",
			"icon": "assets/music-moods/pack.png"
		},
		"entrypoints": {
			"client": [
				"gay.ampflower.musicmoods.ClientMain"
			],
			"modmenu": [
				"gay.ampflower.musicmoods.client.MusicMoodsModMenuCompat"
			]
		},
		"intermediate_mappings": "net.fabricmc:intermediary",
		"depends": [
			{
				"id": "minecraft",
				"versions": {
					"all": ["${minecraft_required}"]
				}
			},
			{
				"id": "quilt_loader",
				"versions": ">=0.17.0-"
			},
			{
				"id": "java",
				"versions": ">=${java}"
			},
			{
				"id": "spruceui",
				"versions": "*"
			}
		]
	},
	"mixin": "music-moods.mixin.json",
	"minecraft": {
		"environment": "client"
	}
}

It was primarily due to using a new feature that wasn't present in 0.18, although looking at the code that faulted, there wasn't really anything new that would help determine that there's an issue if such an error slipped through.

@Ampflower
Copy link
Contributor Author

Hm it does seem that helpful data is emitted now?
I'll go ahead and throw more junk data around and see what happens

@Ampflower
Copy link
Contributor Author

Found one potential confusing:

...
"entrypoints": { "test": {} }

Emits:

org.quiltmc.json5.exception.ParseException: entry inside "entrypoints" in object form is missing the "adapter" field
	at org.quiltmc.loader.impl.metadata.qmj.V1ModMetadataReader.readAdapterLoadableClassEntry(V1ModMetadataReader.java:669)
	at org.quiltmc.loader.impl.metadata.qmj.V1ModMetadataReader.readAdapterLoadableClassEntries(V1ModMetadataReader.java:656)```

Other than that so far seems solid

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

2 participants