{"record":{"id":"609a888aa626d7a4","repo":"pinpoint-apm/pinpoint","slug":"name-is-well-known","errorCode":null,"errorMessage":"name is well known","messagePattern":"name is well known","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"service-module/src/main/java/com/navercorp/pinpoint/service/service/ServiceRegistryServiceImpl.java","lineNumber":37,"sourceCode":"@org.springframework.stereotype.Service\npublic class ServiceRegistryServiceImpl implements ServiceRegistryService {\n\n    private final ServiceRegistryDao serviceRegistryDao;\n    private final IdGenerator<ServiceUid> serviceUidGenerator;\n\n    public ServiceRegistryServiceImpl(ServiceRegistryDao serviceRegistryDao,\n                                      IdGenerator<ServiceUid> serviceUidGenerator) {\n        this.serviceRegistryDao = Objects.requireNonNull(serviceRegistryDao, \"serviceRegistryDao\");\n        this.serviceUidGenerator = Objects.requireNonNull(serviceUidGenerator, \"serviceUidGenerator\");\n    }\n\n    @Override\n    @Transactional(rollbackFor = {Exception.class})\n    @Retryable(retryFor = DuplicateKeyException.class, maxAttempts = 3)\n    public Service insertService(String name) {\n        StringPrecondition.requireHasLength(name, \"name\");\n        if (Service.wellKnownService(name) != null) {\n            throw new IllegalArgumentException(\"name is well known\");\n        }\n\n        int uid = serviceUidGenerator.generate().getUid();\n        try {\n            serviceRegistryDao.insertService(uid, name);\n        } catch (DuplicateKeyException e) {\n            if (serviceRegistryDao.selectServiceByName(name) != null) {\n                throw new DataIntegrityViolationException(\"Duplicate service name: \" + name, e);\n            }\n            throw e;\n        }\n\n        return new Service(name, uid);\n    }\n\n    @Override\n    @Transactional(readOnly = true)\n    public List<String> getServiceNames() {","sourceCodeStart":19,"sourceCodeEnd":55,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/service-module/src/main/java/com/navercorp/pinpoint/service/service/ServiceRegistryServiceImpl.java#L19-L55","documentation":"insertService rejects names that are statically registered as well-known services (Service.wellKnownService(name) != null). Well-known names have reserved UIDs and must not be inserted into the dynamic service registry. The check runs after the basic length precondition, inside a transactional, retryable method.","triggerScenarios":"Calling serviceRegistryService.insertService(name) (or the REST POST endpoint that delegates to it) with a name matching a well-known service constant.","commonSituations":"Registering a service whose name collides with built-in Pinpoint services (e.g. names pre-seeded in Service's well-known table); importing legacy data that includes reserved names.","solutions":["Choose a different, non-reserved service name.","Check the name beforehand with Service.wellKnownService(name) and reject in your UI/validation layer.","If you genuinely need that name, use the well-known service's existing UID instead of inserting a new row."],"exampleFix":"// before\nserviceRegistryService.insertService(\" pinpoint\"); // well-known name\n// after\nif (Service.wellKnownService(name) == null) {\n    serviceRegistryService.insertService(name);\n}","handlingStrategy":"validation","validationCode":"if (Service.wellKnownService(name) != null) throw new IllegalArgumentException(\"well-known service name: \" + name);\nStringPrecondition.requireHasLength(name, \"name\");","typeGuard":null,"tryCatchPattern":"try { service = serviceRegistryService.insertService(name); } catch (IllegalArgumentException e) { /* surface 'name is reserved' to user */ }","preventionTips":["Validate names against Service.wellKnownService before submit","Keep a UI-side list of reserved names"],"tags":["service-registry","reserved-name","illegal-argument"],"backgroundTag":"invalid-argument-value","analyzedSha":"744c3d3075e595656abb1ae331ad2c0e4c9eb996","analyzedAt":"2026-09-07T18:48:45.289Z","contentChangedAt":"2026-09-07T18:48:45.289Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}