godaddy-wordpress / godaddy-wordpress/pagely-atomic-client

Domain not available to register SSL certificate after app is created

Open
#39 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
4
Forks
3
PR merge metrics
No merged PRs in 30d

Description

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:

```bash
# 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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.