MyCATApache/Mycat-Server · error · RuntimeException
fetch Param Values error.
Error message
fetch Param Values error.
What it means
IncrSequenceHandler.nextId retrieves the parameter value map for the given prefix (the sequence's current/max values, typically fetched from a store such as ZooKeeper or DB). If the map comes back null, meaning the handler could not load the sequence's parameters at all, it throws this RuntimeException instead of returning an ID. The failure is usually a symptom of the underlying storage fetch (getParaValMap implementation) failing or the sequence prefix not existing there.
Solutions
- Verify the sequence prefix exists in the backing store (e.g. ZooKeeper node or sequence DB table) and that getParaValMap can read it for that exact name.
- Check connectivity and credentials of the store used by the concrete handler (DB user, ZK quorum) and retry after restoring the connection.
- Check server logs/MyCat configuration (sequence handler type and prefix settings) for a mismatch between the app's sequence name and the configured one.
- Wrap nextId calls with retry/fallback logic, since transient store outages surface as this error.
Example fix
// before
long id = incrSequenceHandler.nextId("ORDER_SEQ");
// after
try {
long id = incrSequenceHandler.nextId("ORDER_SEQ");
} catch (RuntimeException e) {
if (e.getMessage() != null && e.getMessage().startsWith("fetch Param Values error")) {
// check ZK/DB store for ORDER_SEQ entry, then retry
}
throw e;
} Defensive patterns
Strategy: retry
Validate before calling
public static boolean sequenceParamsAvailable(IncrSequenceHandler h, String prefix) {
try {
return h.getParaValMap(prefix) != null; // or a read-only existence check on the store
} catch (Exception e) { return false; }
} Type guard
if (paraMap == null || !paraMap.containsKey(prefix + KEY_CUR_NAME)
|| !paraMap.containsKey(prefix + KEY_MAX_NAME)) {
throw new IllegalStateException("sequence parameters unavailable for " + prefix);
} Try / catch
try {
return handler.nextId(prefixName);
} catch (RuntimeException e) {
if ("fetch Param Values error.".equals(e.getMessage())) {
waitForStoreRecovery();
return handler.nextId(prefixName); // one bounded retry
}
throw e;
} Prevention
- Ensure every sequence prefix used by apps is provisioned in the backing store (ZK/DB) before deployment.
- Monitor store connectivity (ZK quorum, sequence DB) and alert on failures.
- Use exact, case-correct sequence names; centralize them in constants/config.
- Add bounded retry with backoff around ID generation for transient store outages.
When it happens
Trigger: Calling nextId(prefixName) where getParaValMap(prefixName) returns null — i.e. the configured sequence prefix has no entry in the backing store, the store is unreachable/returns an error, or the fetch timed out and the implementation signals failure with null.
Common situations: sequence_conf/sequence store missing the requested prefix name; ZooKeeper or DB connectivity problems; wrong prefix (table name) passed to nextId; environment/cluster misconfiguration after failover.
Understand the failure class
Background: Database query failed: Internal Server Error 500s wrapping SQL, Prisma, and connection failures — what to check first — this error's family across 16 libraries.
Related errors
- can't fetch sequnce in db,sequnce
- can't find definition for sequence
- fetching sequence can not support the db driver
- sequnce not found in db table
- sequnce fetched failed from db
AI-assisted analysis of MyCATApache/Mycat-Server@65f8d8beb7 (2026-09-11).
Data as JSON: /api/errors/8bd44638025755ac.
Report an issue: GitHub.
Appendix: source
Thrown at src/main/java/io/mycat/route/sequence/handler/IncrSequenceHandler.java:60
public static final String FILE_NAME = "sequence_conf.properties";
public static final String KEY_HIS_NAME = ".HISIDS";// 1-10000,50001-60000
public static final String KEY_MIN_NAME = ".MINID";// 1
public static final String KEY_MAX_NAME = ".MAXID";// 10000
public static final String KEY_CUR_NAME = ".CURID";// 888
public abstract Map<String, String> getParaValMap(String prefixName);
public abstract Boolean updateCURIDVal(String prefixName, Long val);
public abstract Boolean fetchNextPeriod(String prefixName);
@Override
public long nextId(String prefixName) {
Map<String, String> paraMap = this.getParaValMap(prefixName);
if (null == paraMap) {
throw new RuntimeException("fetch Param Values error.");
}
Long nextId = Long.parseLong(paraMap.get(prefixName + KEY_CUR_NAME)) + 1;
Long maxId = Long.parseLong(paraMap.get(prefixName + KEY_MAX_NAME));
if (nextId > maxId) {
fetchNextPeriod(prefixName);
return nextId(prefixName);
}
updateCURIDVal(prefixName, nextId);
return nextId.longValue();
}
}View on GitHub (pinned to 65f8d8beb7)