Page 1 of 1

[SOLVED]certbot and certbot-auto mga6

PostPosted: Nov 8th, '18, 12:30
by pernel
I would like to use certbot or certbot-auto to setup automatic generation of authority signed certificates. A package for certbot exists in the distro. I tested the command
Code: Select all
certbot -d xyz.se --apache
giving the following output:
Code: Select all
Traceback (most recent call last):
  File "/usr/bin/certbot", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 3140, in <module>
    @_call_aside
  File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 3126, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 3153, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 640, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 941, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 828, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pyasn1' distribution was not found and is required by requests

Is there any way to make cerbot recognise the distribution correcltly?

certbot-auto gives the following output:
Code: Select all
[root@lindell ~]# certbot-auto
Upgrading certbot-auto 0.27.1 to 0.28.0...
Replacing certbot-auto...
Creating virtual environment...
Installing Python packages...
Installation succeeded.
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Certbot doesn't know how to automatically configure the web server on this system. However, it can still get a certificate for you. Please run "certbot-auto certonly" to do so. You'll need to manually configure your web server to use the resulting certificate.
[root@lindell ~]#

"certbot-auto certonly" is not a good option since the generated certificate is valid only 3 months and requires manual configuration.
Is there any way I can make certbot-auto work with mga 6 and apache?

Re: certbot and certbot-auto mga6

PostPosted: Nov 8th, '18, 20:15
by doktor5000
FWIW, you may want to follow https://bugs.mageia.org/show_bug.cgi?id=22636 for a similar issue, although in your case a different library seems to be missing.
Try installing python-pyasn1 or python3-pyasn1 and then try again.

For some working alternatives, check e.g. https://bugs.mageia.org/show_bug.cgi?id=17021

Re: certbot and certbot-auto mga6

PostPosted: Nov 9th, '18, 17:53
by pernel
Had already python-pyasn1 before but after installation of python3-pyasn1 the error message:
Code: Select all
[root@lindell ~]# certbot -d xyz.se --apache
Saving debug log to /var/log/letsencrypt/letsencrypt.log
The apache plugin is not working; there may be problems with your existing configuration.
The error was: PluginError('There has been an error in parsing the file /etc/httpd/conf/conf.d/security.conf on line 17: Syntax error',)
[root@lindell ~]#

is much more short and points to an error in "/etc/httpd/conf/conf.d/security.conf.
The output of letsencrypt-log is:
Code: Select all
2018-11-09 16:40:54,183:DEBUG:certbot.main:certbot version: 0.20.0
2018-11-09 16:40:54,184:DEBUG:certbot.main:Arguments: ['-d', 'xyz.se', '--apache']
2018-11-09 16:40:54,185:DEBUG:certbot.main:Discovered plugins: PluginsRegistry(PluginEntryPoint#apache,PluginEntryPoint#manual,PluginEntryPoint#nginx,PluginEntryPoint#null,PluginEntryPoint#standalone,PluginEntryPoint#webroot)
2018-11-09 16:40:54,206:DEBUG:certbot.log:Root logging level set at 20
2018-11-09 16:40:54,207:INFO:certbot.log:Saving debug log to /var/log/letsencrypt/letsencrypt.log
2018-11-09 16:40:54,208:DEBUG:certbot.plugins.selection:Requested authenticator apache and installer apache
2018-11-09 16:40:54,374:DEBUG:certbot_apache.configurator:Apache version is 2.4.27
2018-11-09 16:40:54,727:DEBUG:certbot.plugins.disco:Other error:(PluginEntryPoint#apache): There has been an error in parsing the file /etc/httpd/conf/conf.d/security.conf on line 17: Syntax error
Traceback (most recent call last):
  File "/usr/lib/python3.5/site-packages/certbot/plugins/disco.py", line 130, in prepare
    self._initialized.prepare()
  File "/usr/lib/python3.5/site-packages/certbot_apache/configurator.py", line 227, in prepare
    self.check_parsing_errors("httpd.aug")
  File "/usr/lib/python3.5/site-packages/certbot_apache/augeas_configurator.py", line 77, in check_parsing_errors
    raise errors.PluginError(msg)
certbot.errors.PluginError: There has been an error in parsing the file /etc/httpd/conf/conf.d/security.conf on line 17: Syntax error
2018-11-09 16:40:54,728:DEBUG:certbot.plugins.selection:No candidate plugin
2018-11-09 16:40:54,728:DEBUG:certbot.plugins.selection:Selected authenticator None and installer None


In https://bugs.mageia.org/show_bug.cgi?id=22636 they mention two missing double quotes in the file "/etc/httpd/conf/conf.d/security.conf". Unfortunately I can not understand exactly where in this file.
Any clue to this?

Re: certbot and certbot-auto mga6

PostPosted: Nov 10th, '18, 16:43
by doktor5000
pernel wrote:In https://bugs.mageia.org/show_bug.cgi?id=22636 they mention two missing double quotes in the file "/etc/httpd/conf/conf.d/security.conf". Unfortunately I can not understand exactly where in this file.
Any clue to this?


Well, I would guess there's at least an issue about parsing line 17, so it might help to post it here ...
pernel wrote:The error was: PluginError('There has been an error in parsing the file /etc/httpd/conf/conf.d/security.conf on line 17: Syntax error',)

Re: certbot and certbot-auto mga6

PostPosted: Apr 5th, '20, 11:17
by pernel
After installing endless of python2.7 packages and updated with "pip" finally certbot-auto --renew worked in the end of 2019. Unfortunately I can't tell exactly which packages was lacking.