Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Domain not available to register SSL certificate after app is created #39

Open
adriantoll opened this issue Mar 29, 2022 · 1 comment
Open

Comments

@adriantoll
Copy link

adriantoll commented Mar 29, 2022

When using a Bash script to create an app, promote the main domain to primary, and register an SSL certificate for that domain, the certificate registration doesn't work. (See issue #38 for the reason behind the command under "Remove invalid line at end of variable"). This is the script:

# Create the app
app_json_object_raw=$( atomic apps:create "$account_id" "$site_url" "$site_url" )

# Remove invalid line at end of variable
app_json_object=$( sed '/^\[/d' <<< "$app_json_object_raw" )

# Get app id from json object
app_id=$( jq '.[ "id" ]' <<< "$app_json_object" )

# Get domain id from json object
domain_id=$( jq '.[ "aliases" ][ 1 ][ "id" ]' <<< "$app_json_object" )

# Set primary domain
atomic apps:domain:make-primary "$app_id" "$domain_id"

# Register SSL certificate
atomic ssl:le:register "$account_id" "$site_url"

When trying to register the certificate I get this error:

In RequestException.php line 113:
                                                                                                                                           
  Client error: `POST https://mgmt.pagely.com/api/ssl/letsencrypt/register` resulted in a `422 Unprocessable Entity` response:             
  {"status":"ERROR","body":{"domain":{"messages":["Domain(s) starter2.staging.thirdpress.com must be hosted at pagely and  (truncated...)

I also get an error when trying to register the certificate for the domain through the Atomic control panel after that command is run. I presume this is something to do with timing, as if I wait a few minutes then I can issue the certificate through the control panel.

@adriantoll
Copy link
Author

adriantoll commented Mar 29, 2022

Further to this, I just ran that script without the SSL cerficate command, went to register the SSL certificate in the Atomic control panel, and I can't even pick it from the list of available domains despite it being registered with the app. So it looks like it takes quite a while (in relative terms) for the domain to be available to other services.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant