Lodehost logoLodehost

Performance and fixes

File is not a valid mod file: what NeoForge and Forge mean, and how to get the server started

File mods/configured-neoforge-26.1.2-2.7.5.jar is not a valid mod file means the mod loader could not turn that jar into a mod it can load. On NeoForge the same text covers two different situations: a jar the loader skips and moves past, and a jar whose reading failed with an error, which stops the start. This guide explains both from the loader's own code, lists the more specific messages you may see instead, shows how to check which loader a jar was built for, and walks through the fix on Lodehost.

10 min read

Configure your serverPick a plan and order your server.
A grass island with a server tower, a stone block with a square slot in its front, and a mint mod crate with a round mark on its side standing in front of it next to an orange warning sign
The loader only takes crates it can read. A crate with the wrong mark stays outside, and with an error the gate stays shut.

What "is not a valid mod file" means on NeoForge

"Is not a valid mod file" on NeoForge means the loader found a jar in the mods folder and could not read it as a NeoForge mod. The NeoForge mod loader, called FML, has two separate entries behind this one sentence, and they lead to different outcomes:

SituationLevelWhat happens
The jar opens, but no reader accepts it: there is no META-INF/neoforge.mods.toml and no NeoForge mod type in its manifest, and it shows no sign of another loaderWarningThe log says Skipping jar. and the server starts without that file.
Opening the jar failed with an error other than a broken zip, or reading the jar crashed, for example on a mistake in its neoforge.mods.tomlErrorThe start stops. The line appears under Loading errors encountered:.

So the place in the log tells you which one you have. When the line sits under Loading errors encountered: after Failed to start FML, the server stopped because of it. When it sits under Loading warnings encountered: or after Skipping jar., that jar was left out and the start went on. This works the same way on the NeoForge 1.21.1 loader and on the current one.

On the error path, FML attaches the exception that caused it, and before it stops it writes every problem to the log on its own line together with that exception. The short list at the bottom of the log is a summary. The reason for each jar is higher up in logs/latest.log, on the line with the same file name. How to read crash reports and logs shows how to move through that file.

"Is a Fabric mod and cannot be loaded" and other messages instead of "not a valid mod file"

NeoForge has 9 more specific messages for jars it cannot load, and you may get one of these in place of "not a valid mod file". Seven come from one check: when no reader accepts a jar, FML looks inside it for a file that belongs to another system and names that system.

Message on NeoForgeWhat FML found in the jarWhat it means
is for Minecraft Forge or an older version of NeoForge, and cannot be loadedMETA-INF/mods.tomlA Forge build, or a NeoForge build for 1.20.4 or older.
is a Fabric mod and cannot be loadedfabric.mod.jsonA Fabric build.
is a Quilt mod and cannot be loadedquilt.mod.jsonA Quilt build.
is for an old version of Minecraft Forge and cannot be loadedmcmod.infoA mod from the old Forge era.
is a Bukkit or Bukkit-implementor (Spigot, Paper, etc.) plugin and cannot be loadedplugin.ymlA server plugin, not a mod.
is not a jar fileNothing: the file could not be opened as a zipThe file is damaged or not a jar at all.
has an unrecognized FML mod-typeA mod type in the manifest that FML does not knowA jar that declares a type NeoForge has no reader for.

Messages for LiteLoader mods and incompatible OptiFine versions exist as well. In the mods folder all of these are warnings and the jar is skipped, except "is not a jar file", which is an error and stops the start.

The Forge row needs one date. NeoForge 20.5, for Minecraft 1.20.5, stopped reading mods.toml. Its release notes say that from 20.5 the only recognized metadata file is neoforge.mods.toml, still in the META-INF folder. A NeoForge mod built for 1.20.1 or 1.20.4 therefore looks like a Forge mod to a newer NeoForge server.

Plain "is not a valid mod file" as a warning is what remains when FML found none of those files either. That fits a jar that is a library without NeoForge metadata, or something else that ended in .jar. If the server starts anyway and the mod is one you need, replace it with its NeoForge build. If you do not recognise the file, removing it is safe for the start, because the loader was already leaving it out.

Why NeoForge says every mod is not a valid mod file

NeoForge can list dozens of jars as not valid in one go because it reads the whole mods folder first and only then decides to stop. The folder is read in alphabetical order, every problem is collected, and if one of them is an error the loader throws a single exception that lists them all. One server we host on NeoForge 26.1.2 stopped like this, with more than 20 jars listed, every one of them named for NeoForge 26.1:

NeoForge 26.1.2, end of latest.log

[main/ERROR] [net.neoforged.fml.startup.Entrypoint/]: Failed to start FML: net.neoforged.fml.ModLoadingException: Loading errors encountered:
 - File mods/adorable_eggs-NeoForge-26.1.2-1.0.3.jar is not a valid mod file
 - File mods/BiomesOPlenty-neoforge-26.1.2-26.1.2.0.5.jar is not a valid mod file
 - File mods/configured-neoforge-26.1.2-2.7.5.jar is not a valid mod file
...
 - File mods/TerraBlender-neoforge-26.1.2-26.1.2.0.2.jar is not a valid mod file

The list alone does not say why. Because these are errors, each jar has its own earlier log line with the exception that made it fail, and that is where the cause is. A long list with one shared cause looks the same at the bottom as a long list with many different causes, so read a few of those earlier lines before you change anything.

The CancellationException above the list

Just above that list the same server logged an error while scanning a jar nested inside another mod:

NeoForge 26.1.2, just before the list

[main/ERROR] [net.neoforged.fml.loading.modscan.BackgroundScanHandler/SCAN]: An error occurred scanning file jar(mods/SubtleEffects-neoforge-26.1-1.14.3.jar) > jar(mods/SubtleEffects-neoforge-26.1-1.14.3.jar > mixinconstraints-1.1.0.ja...
java.util.concurrent.CancellationException
 at net.neoforged.fml.loading.moddiscovery.ModFile.close(ModFile.java:246) ~[loader-11.0.15.jar:11.0]
 at net.neoforged.fml.loading.FMLLoader.close(FMLLoader.java:245) [loader-11.0.15.jar:11.0]
 at net.neoforged.fml.loading.FMLLoader.create(FMLLoader.java:415) [loader-11.0.15.jar:11.0]

This one is a result, not a cause. In the loader source, line 415 of FMLLoader.create is the clean-up that runs after startup has already failed, and ModFile.close cancels the background scan of each mod that was still running. The scan of SubtleEffects was cut off because the loader was shutting down. You can leave this line aside and look for the per-jar error lines instead.

How to check which loader a mod jar is for

You can tell which loader a mod jar is for by one file inside it. A jar is a zip archive, so any zip tool on your own computer opens it. Look for these files:

File inside the jarBuilt for
META-INF/neoforge.mods.tomlNeoForge 20.5 and newer (Minecraft 1.20.5 and up)
META-INF/mods.tomlForge, or NeoForge before 20.5
fabric.mod.jsonFabric
quilt.mod.jsonQuilt
plugin.ymlBukkit, Spigot or Paper, as a plugin

Some mods ship one jar with more than one of these files. NeoForge reads META-INF/neoforge.mods.toml whenever it is there and only looks for the other files when no reader took the jar, so a jar with both META-INF/neoforge.mods.toml and fabric.mod.json can be fine on NeoForge. A file name with "neoforge" in it is a hint, not proof. When the loader reports an error on a jar that does contain META-INF/neoforge.mods.toml, the file is the right kind and the problem is in reading it. The earlier log line for that jar says what went wrong.

When the jar is right but needs other mods to load, the message changes to a dependency error. That case has its own guide: missing mod dependencies.

How to fix "not a valid mod file" on Lodehost

Fixing "not a valid mod file" on Lodehost comes down to 4 things: find the reason in the log, take the jar out, put in the right build, and start again.

  1. Make a backup first

    On the Backups tab, make a backup before you remove anything. If a removed mod turns out to hold world data, you can restore it with the server stopped.

  2. Find the reason for each jar

    Open logs/latest.log on the Files tab and search for the file name of a jar from the list. On an error, the earlier line with that name carries the exception. A different message from the table above, such as "is a Fabric mod", tells you the jar is for another loader.

  3. Remove the jar

    On the Mods tab, find the file under Installed mods and press Remove. Do this for every jar the log names.

  4. Install the build for your server

    Search the mod under Verified Modrinth catalog and press Verify & install. The catalog only offers builds for your server's loader and its exact Minecraft version, and required dependencies come along. The version your server runs is in Settings.

  5. Re-upload a mod that is not in the catalog

    Download the build for your loader and Minecraft version from the mod's own page, then use Upload on the Files tab in the mods folder, or From link with a direct download address. Compare the file size with the one on the download page. A jar that is smaller arrived incomplete and has to go in again.

  6. Start the server and read the end of the log

    If the start stops again, the list at the bottom shows what is left. Work through it the same way.

Do not remove the whole list on a guess

When every mod in the folder is listed, the cause may be shared, and removing them all may only hide it. Read the earlier error lines for a few of the jars first. If they point to the same thing and you cannot place it, back up the mods folder before you change it. Server not starting covers what else to check when a start fails.

"Is not a valid mod file" on Forge 1.20.1 and newer

On Forge, "File {2} is not a valid mod file" is a warning, both on 1.20.1 and on the newest Forge branch. Forge collects the files it had to drop as broken and reports them after loading. A dedicated server logs Mods loaded with followed by the number of warnings, prints each one and carries on without those jars. Earlier in the log, Forge writes File ... has been ignored - it is invalid for a jar that failed its checks.

Forge also has more specific messages, "is a Fabric mod", "is for an older version of Forge" and "is not a jar file" among them. On 1.20.1 Forge checks for all of them. On the newest Forge branch, a note in its source says only the "not a jar file" check runs for now, so a Fabric jar there shows the plain "not a valid mod file". A Forge mod is recognised by META-INF/mods.toml, which means a NeoForge mod for 1.20.5 or newer, with only neoforge.mods.toml, is not one Forge can read.

So if a Forge server stops and you see this line, the line itself is not what stopped it. Look further down the log for the error that ended the start. A NoClassDefFoundError or a mixin that failed to apply are two causes with their own guides.

Written and checked by the Lodehost team, last reviewed on 16 November 2026.

FAQ

"Not a valid mod file" questions

What does "is not a valid mod file" mean in Minecraft?

The mod loader could not read that jar as a mod for itself. On NeoForge it is a warning when no reader accepts the jar, and an error that stops the start when reading the jar failed. On Forge it is a warning and the server carries on without the file.

Why does NeoForge list all my mods as not valid?

NeoForge reads the whole mods folder first and reports every problem in one list before it stops. The list does not give the reason. Each jar has an earlier line in latest.log with the exception that made it fail.

Can I use a Forge mod on NeoForge?

Not on NeoForge for Minecraft 1.20.5 and newer. Since NeoForge 20.5 the loader only reads META-INF/neoforge.mods.toml, and a jar with only META-INF/mods.toml gets the message that it is for Minecraft Forge or an older version of NeoForge.

What is the difference between "not a valid mod file" and "is not a jar file"?

"Is not a jar file" means the loader could not open the file as a zip archive at all, so the file is damaged or not a jar. "Not a valid mod file" means it opened, or failed for another reason, but did not become a mod.

What does the CancellationException before the list mean?

It is part of the shutdown after the start has already failed. The loader cancels the background scans of all mods while it closes, and a scan that was still running logs this. The cause is in the per-jar error lines.

Do I have to remove the mod?

Only if it is the wrong build or broken. Replace it with the build for your loader and exact Minecraft version. If the log shows the jar was only skipped with a warning, the server starts without it anyway.

Pick the build that fits, from the start.

Single NeoForge mods install from the Mods tab: mods on Modrinth with a NeoForge build for your exact version, together with what they require.

See NeoForge hosting