2

I have a cron set up to update certbot. It mails a deprecation warning every day. How do I stop the deprecation warning?

Cron <root@ip-99-99-99-99> /root/certbot-auto renew --quiet

/root/.local/share/letsencrypt/lib/python2.6/site-packages/cryptography/__init__.py:26: DeprecationWarning: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of cryptography will drop support for Python 2.6
  DeprecationWarning

I tried to file a bug report, but they closed it. https://github.com/certbot/certbot/issues/3984

I tried to install Python2.7 but I can't get certbot to run with Python2.7.

[root@kizbit ~]# scl enable python27 "python --version"
Python 2.7.8

[root@kizbit ~]# scl enable python27 "/root/certbot-auto renew"
/root/.local/share/letsencrypt/lib/python2.6/site-packages/cryptography/__init__.py:26: DeprecationWarning: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of cryptography will drop support for Python 2.6
  DeprecationWarning

It still uses Python 2.6 and still produces a warning. I also tried:

[root@kizbit ~]# scl enable python27 "python /root/certbot-auto renew"
  File "/root/certbot-auto", line 18
    if [ -z "$XDG_DATA_HOME" ]; then
                           ^
SyntaxError: invalid syntax

WITH 2.6 IT WORKS BUT GIVES DEPRECATION:

[root@kizbit ~]# /root/certbot-auto renew
/root/.local/share/letsencrypt/lib/python2.6/site-packages/cryptography/__init__.py:26: DeprecationWarning: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of cryptography will drop support for Python 2.6
  DeprecationWarning

Centos 6.8, certbot 0.12.0

3
  • 2
    Move on. It's past time to update to CentOS 7. Feb 9, 2017 at 6:29
  • @MichaelHampton How do I do that? I run yum upgrade and it doesn't change the version.
    – Chloe
    Feb 12, 2017 at 22:03
  • @MichaelHampton: it's not about moving on. I'm running Ubuntu 20 and just got that warning. Amazing how annoying it can still be to get a TLS certificate in 2020. Sep 4, 2020 at 3:36

4 Answers 4

0

Your issue got closed as it is a duplicate from that one, with links to further explanations.

There's no way around it: the Python version available on your system is getting old. Spamming "it is still happening" won't help, a member requested for help already. If that issue matters to your, feel free to contribute a PR.

Otherwise, I wouldn't recommend dropping certbot output to /dev/null, ... but if these warnings are really problematic, then you may consider just discarding them.

1
0

Let's Encrypt community circa 2015 came up with a couple ways to get 2.7, CentOS software collections or third party repositories. Redhat / CentOS 6.x users need python 2.7

It amounts to installing the python27 packages and replacing python2 with python27 in the client. Maybe not strictly necessary since certbot is functional with 2.6, but a good exercise in getting newer software.

Long term you will want to migrate to newer versions of CentOS.

4
  • But every time it updates itself (about every 2 weeks) then it will overwrite all the changes. That doesn't sound like a good idea.
    – Chloe
    Mar 3, 2017 at 2:04
  • @Chloe Then turn off updates to certbot. You won't move to new version of the OS. Why would you want to get latest version of tools without the latest version of the OS to run them on?
    – user396327
    Mar 3, 2017 at 3:02
  • It's impossible to upgrade the OS. I ran yum upgrade and it wouldn't update the OS. I'm not starting over and re-configuring everything on a new VPS.
    – Chloe
    Mar 6, 2017 at 3:52
  • There are various ways to run an interpreter, such as using software collections and prefixing your certbot with "scl enable python27" I linked to a lets encrypt community forum, they had a couple more ideas. Mar 7, 2017 at 6:33
0

As a dirty, temporary workaround, you can try something like this in your cron entry:

certbot renew ... 2>&1 | grep -v DeprecationWarning
0

I got Python2.7 installed on CentOS 6 with SCL.

yum install -y centos-release-scl
yum install -y python27
# scl enable python27 "python -V"
Python 2.7.8

Then you also have to delete

rm -r ~/.local/share/letsencrypt

And reinstall something Python 2.7 related (libraries? config?) by just running it plain

scl enable python27 "./certbot-auto"

Inside the crontab:

@daily scl enable python27 "/root/certbot-auto renew --quiet"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .