title: Serverless Stuck Unable to Create Domain
body: <p>I have a Lambda service that was created with Serverless. I recently upgraded to Serverless 3. (3.22.0 specifically.) I'm also using serverless-offline 8.8.1 and serverless-domain-manager 4.2.3.</p>
  <p>It seems to be &quot;stuck&quot; in a state where the domain cannot be deleted or re-created.</p>
  <p>After the upgrade, publishing to my prod stage would fail with:</p>
  <pre><code>Serverless Domain Manager: Info: api-prod.example.com:  Found apiId: pnedwg0m9b
  Serverless Domain Manager: Error: api-prod.example.com:  ConflictException: Base path already exists for this domain name
  Serverless Domain Manager: Error: api-prod.example.com:  Error: Error: api-prod.example.com: Unable to create basepath mapping.
  
  ...
  
  Error: Error: Unable to setup base domain mappings for api-prod.example.com
  </code></pre>
  <p>The domain settings in serverless.yml look like this:</p>
  <pre><code>custom:
    customDomain:
      domainName: api-${opt:stage, 'dev'}.example.com
      basePath: ''
      stage: ${self:provider.stage}
      createRoute53Record: true
  </code></pre>
  <p>After searching online, I thought the issue might be that the domain was created with an older version of serverless, so I manually deleted it in the Route53 section of the AWS console, then waited overnight. It doesn't appear in the console now.</p>
  <p>I tried to re-create it by doing <strong>both</strong>:</p>
  <p>Having createRoute53Record: true in the serverless.yml and running:</p>
  <pre><code>SLS_DEBUG=* serverless deploy --verbose --stage prod
  </code></pre>
  <p>This gives the same &quot;unable to setup base domain mapping...&quot; error as before.</p>
  <p><strong>... and also manually creating it:</strong></p>
  <pre><code>SLS_DEBUG=* serverless create_domain --verbose --stage prod
  </code></pre>
  <p>That just gives the following error, despite the fact that the domain is <strong>not</strong> visible in the AWS console:</p>
  <pre><code>Custom domain api-prod.example.com already exists.
  </code></pre>
  <p>If I try to delete it via serverless, it also throws an error:</p>
  <pre><code>SLS_DEBUG=* serverless delete_domain --verbose --stage prod
  
  Serverless Domain Manager: Error: api-prod.example.com:  InvalidChangeBatch: [Tried to delete resource record set [name='api-prod.example.com.', type='A'] but it was not found, Tried to delete resource record set [name='api-prod.example.com.', type='AAAA'] but it was not found]
  Serverless Domain Manager: Error: api-prod.example.com:  Error: Error: Failed to DELETE A Alias for api-prod.example.com
  </code></pre>
  <p>Some other notes:</p>
  <ul>
  <li>The &quot;development&quot; stage doesn't result in any errors when deploying. (I created the domain with the create_domain command, but even with createRoute53Record:true, it deploys without error.)</li>
  <li>I've tried bumping <strong>serverless-domain-manager</strong> to 6.1, but that didn't help.</li>
  <li>The api-prod.example.com is not present in neither Route53 nor in API Gateway&gt;Custom domain names.</li>
  <li>Not sure if it's relevant but this same API was exposed by <strong>both</strong> api-prod.example.com <strong>and</strong> api.example.com. I'm not sure how the api.example.com one was created.</li>
  </ul>