apache/dolphinscheduler · error · ServiceException

SAVE_ERROR

SAVE_ERROR

Error message

SAVE_ERROR

What it means

Thrown by AlertPluginInstanceServiceImpl.create when alertPluginInstanceMapper.insert() returns 0, meaning no row was inserted into t_ds_alert_plugin_instance. The service treats any non-insert as a generic save failure and raises ServiceException(Status.SAVE_ERROR).

Source

Thrown at dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/AlertPluginInstanceServiceImpl.java:119

            throw new ServiceException(Status.USER_NO_OPERATION_PERM);
        }

        AlertPluginInstance alertPluginInstance = new AlertPluginInstance();
        String paramsMapJson = parsePluginParamsMap(pluginInstanceParams);
        alertPluginInstance.setPluginInstanceParams(paramsMapJson);
        alertPluginInstance.setInstanceName(instanceName);
        alertPluginInstance.setPluginDefineId(pluginDefineId);

        if (alertPluginInstanceMapper.existInstanceName(alertPluginInstance.getInstanceName()) == Boolean.TRUE) {
            throw new ServiceException(Status.PLUGIN_INSTANCE_ALREADY_EXISTS);
        }

        int i = alertPluginInstanceMapper.insert(alertPluginInstance);
        if (i > 0) {
            log.info("Create alert plugin instance complete, name:{}", alertPluginInstance.getInstanceName());
            return alertPluginInstance;
        }
        throw new ServiceException(Status.SAVE_ERROR);
    }

    /**
     * update alert plugin instance
     *
     * @param loginUser            login user
     * @param pluginInstanceId     plugin instance id
     * @param instanceName         instance name
     * @param pluginInstanceParams plugin instance params
     */
    @Override
    public AlertPluginInstance updateById(User loginUser, int pluginInstanceId, String instanceName,
                                          String pluginInstanceParams) {

        if (!canOperatorPermissions(loginUser, null, AuthorizationType.ALERT_PLUGIN_INSTANCE, ALERT_PLUGIN_UPDATE)) {
            throw new ServiceException(Status.USER_NO_OPERATION_PERM);
        }

View on GitHub (pinned to 02eac45a1b)

Solutions

  1. Check the datasource health and DB error logs around the failed insert (the mapper does not propagate the underlying SQLException).
  2. Verify the alert plugin instance name does not violate unique constraints in t_ds_alert_plugin_instance.
  3. Re-run the insert with SQL logging enabled to see why the row count is 0.
  4. Confirm the alert-plugin-instance table schema matches the current DolphinScheduler version.

Example fix

// before
throw new ServiceException(Status.SAVE_ERROR);
// after
log.error("Insert alert plugin instance affected 0 rows, name:{}", alertPluginInstance.getInstanceName());
throw new ServiceException(Status.SAVE_ERROR);
Defensive patterns

Strategy: try-catch

Validate before calling

// caller-side: verify datasource reachable and name not duplicated before create
AlertPluginInstance existing = alertPluginInstanceService.getByName(loginUser, instanceName);
if (existing != null) throw new IllegalArgumentException("instance name already in use");

Try / catch

try { alertPluginInstanceService.createAlertPluginInstance(loginUser, pluginDefineId, instanceName, params); } catch (ServiceException e) { if (e.getCode() == Status.SAVE_ERROR.getCode()) { /* check DB health, retry or surface DB error */ } throw e; }

Prevention

When it happens

Trigger: Calling the create-alert-plugin-instance API where the mapper insert affects 0 rows — typically a DB constraint failure, connection problem, or transaction rollback silently swallowed at the DAO layer.

Common situations: Database connectivity issues, duplicate instance name colliding with a unique constraint, schema drift after upgrade, or MySQL replication/timeout dropping the insert.

Related errors


AI-assisted analysis of apache/dolphinscheduler@02eac45a1b (2026-09-06). Data as JSON: /api/errors/d024ea9cf663c856. Report an issue: GitHub.