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

[Migrated] Lets Encrypt Certify Issue - 'NoneType' object has no attribute 'groups' #931

Closed
jneves opened this issue Feb 20, 2021 · 3 comments
Labels
auto-closed [Bot] Closed, details in comments no-activity [Bot] Closing soon if no new activity

Comments

@jneves
Copy link
Contributor

jneves commented Feb 20, 2021

Originally from: Miserlou/Zappa#2197 by ksummersill2

I've followed the handy guide reference here to associate a Let's Encrypt SSL certificate and validating it using DNS validation.
https://github.com/Miserlou/Zappa/blob/master/docs/domain_with_free_ssl_dns.md

However, I am receiving the following error message when running:
zappa certify dev

The response given back:

(jobatscale) λ zappa certify dev
Calling certify for stage dev..
Are you sure you want to certify? [y/n] y
Certifying domain dev.jobatscale.com..
'NoneType' object has no attribute 'groups'
Failed to generate or install a certificate! :(

Expected Behavior

Should be able to certified the SSL certificate from the Route 53 domain name and access the application utilizing the specified domain name.

Actual Behavior

Receiving error message.

(jobatscale) λ zappa certify dev
Calling certify for stage dev..
Are you sure you want to certify? [y/n] y
Certifying domain dev.jobatscale.com..
'NoneType' object has no attribute 'groups'
Failed to generate or install a certificate! :(

Possible Fix

I am attempted to try and fix the lets-encrypt.py file for the issue with groups but not really sure where to begin.

Steps to Reproduce

Reproduce by following the guide in the repo: https://github.com/Miserlou/Zappa/blob/master/docs/domain_with_free_ssl_dns.md

Your Environment

  • Zappa version used: 0.52.0

  • Operating System and Python version: Windows 10 / Python 3.8.7

  • The output of pip freeze:
    argcomplete==1.12.2
    boto3==1.16.49
    botocore==1.19.49
    certifi==2020.12.5
    cfn-flip==1.2.3
    chardet==4.0.0
    click==7.1.2
    durationpy==0.5
    Flask==1.1.2
    Flask-PyMongo==2.3.0
    future==0.18.2
    hjson==3.0.2
    idna==2.10
    itsdangerous==1.1.0
    Jinja2==2.11.2
    jmespath==0.10.0
    kappa==0.6.0
    MarkupSafe==1.1.1
    pip-tools==5.5.0
    placebo==0.9.0
    pymongo==3.11.2
    python-dateutil==2.8.1
    python-slugify==4.0.1
    PyYAML==5.3.1
    requests==2.25.1
    s3transfer==0.3.3
    six==1.15.0
    text-unidecode==1.3
    toml==0.10.2
    tqdm==4.55.1
    troposphere==2.6.3
    urllib3==1.26.2
    Werkzeug==0.16.1
    wsgi-request-logger==0.4.6
    zappa==0.52.0

  • Your zappa_settings.json:
    {
    "dev": {
    "app_function": "app.app",
    "parameter_depth": 1,
    "aws_region": "us-east-1",
    "profile_name": "jobatscale",
    "project_name": "jobsatscale",
    "runtime": "python3.7",
    "manage_roles": false,
    "s3_bucket": "jobsatscale",
    "domain": "dev.jobatscale.com",
    "lets_encrypt_key": "account.key",
    "lets_encrypt_expression": "rate(30 days)"
    },
    "dev_ap_east_1": {
    "aws_region": "ap-east-1",
    "extends": "dev"
    },
    "dev_ap_northeast_1": {
    "aws_region": "ap-northeast-1",
    "extends": "dev"
    },
    "dev_ap_northeast_2": {
    "aws_region": "ap-northeast-2",
    "extends": "dev"
    },
    "dev_ap_northeast_3": {
    "aws_region": "ap-northeast-3",
    "extends": "dev"
    },
    "dev_ap_south_1": {
    "aws_region": "ap-south-1",
    "extends": "dev"
    },
    "dev_ap_southeast_1": {
    "aws_region": "ap-southeast-1",
    "extends": "dev"
    },
    "dev_ap_southeast_2": {
    "aws_region": "ap-southeast-2",
    "extends": "dev"
    },
    "dev_ca_central_1": {
    "aws_region": "ca-central-1",
    "extends": "dev"
    },
    "dev_cn_north_1": {
    "aws_region": "cn-north-1",
    "extends": "dev"
    },
    "dev_cn_northwest_1": {
    "aws_region": "cn-northwest-1",
    "extends": "dev"
    },
    "dev_eu_central_1": {
    "aws_region": "eu-central-1",
    "extends": "dev"
    },
    "dev_eu_north_1": {
    "aws_region": "eu-north-1",
    "extends": "dev"
    },
    "dev_eu_west_1": {
    "aws_region": "eu-west-1",
    "extends": "dev"
    },
    "dev_eu_west_2": {
    "aws_region": "eu-west-2",
    "extends": "dev"
    },
    "dev_eu_west_3": {
    "aws_region": "eu-west-3",
    "extends": "dev"
    },
    "dev_sa_east_1": {
    "aws_region": "sa-east-1",
    "extends": "dev"
    },
    "dev_us_east_2": {
    "aws_region": "us-east-2",
    "extends": "dev"
    },
    "dev_us_gov_east_1": {
    "aws_region": "us-gov-east-1",
    "extends": "dev"
    },
    "dev_us_gov_west_1": {
    "aws_region": "us-gov-west-1",
    "extends": "dev"
    },
    "dev_us_west_1": {
    "aws_region": "us-west-1",
    "extends": "dev"
    },
    "dev_us_west_2": {
    "aws_region": "us-west-2",
    "extends": "dev"
    },
    "staging": {
    "app_function": "app.app",
    "parameter_depth": 1,
    "aws_region": "us-east-1",
    "profile_name": "jobatscale",
    "project_name": "jobsatscale",
    "runtime": "python3.7",
    "manage_roles": false,
    "s3_bucket": "jobsatscale",
    "domain": "staging.jobatscale.com",
    "lets_encrypt_key": "account.key",
    "lets_encrypt_expression": "rate(30 days)"
    },
    "production": {
    "app_function": "app.app",
    "parameter_depth": 1,
    "aws_region": "us-east-1",
    "profile_name": "jobatscale",
    "project_name": "jobsatscale",
    "runtime": "python3.7",
    "manage_roles": false,
    "s3_bucket": "jobsatscale",
    "domain": "jobatscale.com",
    "lets_encrypt_key": "account.key",
    "lets_encrypt_expression": "rate(30 days)"
    }
    }

@sean-marten
Copy link

I actually ran into the same issue here. I believe the problem is because, like you, I am on a windows machine. If you try running the lines of code in this method on your account.key file, you will notice the output has the carriage returns (\r) at the end of lines along with the line feeds (\n). That makes this re.match return None and thus resulting in the error you are seeing.

Workarounds:

  1. Fork the repo and edit the Regex pattern here to include \r before each \n character and then install from the fork.
  2. Same as 1, but just edit the files where zappa is downloaded on your computer.
  3. Make a dockerfile that installs zappa and copies over your necessary files. Run the docker container and execute the zappa certify command from there.

Copy link

github-actions bot commented Apr 3, 2024

Hi there! Unfortunately, this Issue has not seen any activity for at least 90 days. If the Issue is still relevant to the latest version of Zappa, please comment within the next 10 days if you wish to keep it open. Otherwise, it will be automatically closed.

@github-actions github-actions bot added the no-activity [Bot] Closing soon if no new activity label Apr 3, 2024
Copy link

Hi there! Unfortunately, this Issue was automatically closed as it had not seen any activity in at least 100 days. If the Issue is still relevant to the latest version of Zappa, please open a new Issue.

@github-actions github-actions bot added the auto-closed [Bot] Closed, details in comments label Apr 13, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-closed [Bot] Closed, details in comments no-activity [Bot] Closing soon if no new activity
Projects
None yet
Development

No branches or pull requests

2 participants