The problem Requesting a certificate for example.com An unexpected error occurred: AttributeError: ‘Meta’ object has no attribute ‘profiles’ The solution Upgrade or reinstall py311-acme Debugging Check /var/log/letsencrypt/letsencrypt.log for JSON dump of the Directory object: DEBUG:acme.client:Sending GET request to https://acme-v02.api.letsencrypt.org/directory. DEBUG:acme.client:Received response: { "keyChange": "https://acme-v02.api.letsencrypt.org/acme/key-change", "meta": { "caaIdentities": [ "letsencrypt.org" ], "profiles": { "classic": "https://letsencrypt.org/docs/profiles#classic", "shortlived":… Continue reading FreeBSD Certbot: AttributeError: ‘Meta’ object has no attribute ‘profiles’
Tag: python
Using peewee with mysql-connector-python
The problem You already import mysql.connector in your project and you want to use peewee, only problem is: peewee.ImproperlyConfigured: MySQL driver not installed! It’s a known issue since 2018: Why does not peewee support mysql-connector-python? · Issue #1501 · coleifer/peewee. The advice is to: either install pymysql or implement a proxy driver for the mysql.connector… Continue reading Using peewee with mysql-connector-python
Python script for certbot –manual-auth-hook and –manual-cleanup-hook for DNS-01 challenge
You can use a custom Python script as a hook for manual DNS-01 challenge. Example: certbot certonly –non-interactive –agree-tos \ –email webmaster@example.com \ –manual –preferred-challenges dns \ –manual-auth-hook /path/to/certbot-hook.py auth \ –manual-cleanup-hook /path/to/certbot-hook.py cleanup \ -d example.com -d *.example.com You can use the same script for both auth and clean up – pass auth or… Continue reading Python script for certbot –manual-auth-hook and –manual-cleanup-hook for DNS-01 challenge
Debugging cron environment on Azure Web App Service
I wrote a service script in Python and I wanted it to run daily on Azure Web App Service. The catch? Same script will run differently when launched manually via SSH and when triggered with cron. Most notably, it will be missing all your environment variables. So how do you know what actually is in… Continue reading Debugging cron environment on Azure Web App Service
Debugging a 3rd party library in Python
You use a 3rd party library in your Python project and at one point you want to see exactly what it does. For example, you want to see what Yahoo Finance API URLs does yahooquery call internally. It uses a _get_data() function that uses some other function to build the URL and you just want… Continue reading Debugging a 3rd party library in Python
Deploying a Python bot to Azure Web App Service (Free Tier)
Run a Python bot for free on Azure Web App Service Pre-requisite: have a bot. You can use mehov/bot-clock as an example. It works with Telegram, so you will need TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID – see the bot’s readme for more info. Create a new Web App Go to Azure Portal → App Services and create… Continue reading Deploying a Python bot to Azure Web App Service (Free Tier)
Python doesn’t print logs on Render.com
When you deploy a Python Web Service to Render.com, your print statements may not work. They may appear later if they get buffered, but in most cases you want them to be put out immediately in the console. Render logs everything output to STDOUT. So you’ll need to make sure you configure your logging library… Continue reading Python doesn’t print logs on Render.com
Fixing ModuleNotFoundError for both ‘google’ and ‘googleapiclient’
Problem: ModuleNotFoundError: No module named ‘google’ Solution: pip install google pip install google-cloud pip install google-cloud-vision (Yes, pip install google-cloud-vision is important.) Problem: ModuleNotFoundError: No module named ‘googleapiclient’ Solution: pip install google-api-python-client