This error occurs during the self-managed Flex Gateway registration process. It indicates that an attempt was made to register a Flex Gateway with a name that is already in use by an active Flex Gateway within the same organization and environment. Flex Gateway names must be unique across your Anypoint organization, regardless of whether the gateway is operating in Local Mode or Connected Mode.
Error:
$ docker run --entrypoint flexctl -u $UID \
-v "$(pwd)":/registration mulesoft/flex-gateway \
registration create --organization=09a1051d-88re-trac-ted-12345cb49 \
--token=536cdb72-5a31-4574-r3tr4-ct3d24-57c4c7a \
--output-directory=/registration \
--connected=true \
ak-fgw-docker-connected
Starting registration, please be patient.
Error: invalid response: HTTP/1.1 400 Bad Request
Transfer-Encoding: chunked
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
docker run --rm \
Connection: keep-alive
Content-Type: application/json
Date: Sun, 15 Jun 2025 18:23:06 GMT
Expires: 0
Pragma: no-cache
Server: nginx
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Anypnt-Trx-Id: f3167
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-Xss-Protection: 0
143
{"message":"Agent Registry of type RR returned HTTP status code 400 and payload Failed to create target ak-fgw-docker-connected, organizationId 09a1051d-88re-trac-ted-12345cb49, environmentId efd2ece5-0000-0000-re-trac-ted-12345c9, an active target with the same name already exists in this organization and environment"}
0
The most common cause is attempting to register a new Flex Gateway instance with a name that is already assigned to an existing, active Flex Gateway registration in your Anypoint Organization.
Two primary methods can resolve this registration failure:
Register with a Unique Gateway Name:
Register the new Flex Gateway instance using a different name that is not currently in use within your organization.
Delete the Existing Gateway Registration:
If reusing the existing gateway name is necessary, the previously registered Flex Gateway instance with that name must be de-registered from Anypoint Control Plane.
Procedure for Deletion: For step-by-step instructions on deleting an existing gateway registration, refer to this Knowledge article.
Local Mode Gateway Deletion: If the existing Flex Gateway was registered in Local Mode, its instance will not be visible in the Anypoint UI. In such cases, use the API call specified in the Knowledge article to delete its registration.
Post-Resolution:
Once the conflicting gateway registration has been removed (if option 2 was chosen), the new Flex Gateway can be successfully registered with the desired name. Subsequently, proceed with the Flex Gateway agent installation according to your chosen platform (Linux, Container, or Kubernetes).
005036828

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.