halo-dev/halo · error · ServerWebInputException

The plugin version must not be blank.

Error message

The plugin version must not be blank.

What it means

Error "The plugin version must not be blank." thrown in halo-dev/halo.

Source

Thrown at application/src/main/java/run/halo/app/plugin/PluginUtils.java:19

package run.halo.app.plugin;

import java.util.Objects;
import lombok.experimental.UtilityClass;
import org.apache.commons.lang3.StringUtils;
import org.springframework.util.Assert;
import org.springframework.web.server.ServerWebInputException;
import run.halo.app.core.extension.Plugin;

@UtilityClass
public class PluginUtils {

    public static String generateFileName(Plugin plugin) {
        Assert.notNull(plugin, "The plugin must not be null.");
        Assert.notNull(plugin.getMetadata(), "The plugin metadata must not be null.");
        Assert.notNull(plugin.getSpec(), "The plugin spec must not be null.");
        String version = plugin.getSpec().getVersion();
        if (StringUtils.isBlank(version)) {
            throw new ServerWebInputException("The plugin version must not be blank.");
        }
        return String.format("%s-%s.jar", plugin.getMetadata().getName(), version);
    }

    /**
     * Determine if the plugin is in development mode. Currently, we detect it from annotations.
     *
     * @param plugin is a manifest about plugin.
     * @return true if the plugin is in development mode; false otherwise.
     */
    public static boolean isDevelopmentMode(Plugin plugin) {
        var annotations = plugin.getMetadata().getAnnotations();
        return annotations != null && Objects.equals("dev", annotations.get(PluginConst.RUNTIME_MODE_ANNO));
    }
}

View on GitHub (pinned to d2f5165f9c)

Solutions

  1. Set a non-blank 'spec.version' in the plugin's plugin.yaml manifest and rebuild the plugin JAR.
  2. Ensure the version value is a valid semver string (e.g. 1.0.0); an empty or whitespace-only version is rejected.
  3. If the manifest was edited manually, restore the version field and repackage the plugin.

When it happens

Trigger: Thrown at application/src/main/java/run/halo/app/plugin/PluginUtils.java:19 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of halo-dev/halo@d2f5165f9c (2026-08-14). Data as JSON: /api/errors/88aa463c28680559. Report an issue: GitHub.