Unable to start 'Let’s Encrypt'

NextCloudPi version v1.9.1
NextCloudPi image NextCloudPi_01-14-19
distribution Raspbian GNU/Linux 9
Nextcloud version 15.0.5.3

When trying to enable letsencrypt it fails with:

[ letsencrypt ]
/usr/local/bin/ncp/NETWORKING/letsencrypt.sh: line 62: /etc/letsencrypt/letsencrypt-auto: No such file or directory

Both ports 80 and 443 are accessible from the internet

the directory letsencrypt is empty except for
cli.ini
live
renewal-hook

where is all the other stuff, and does anyone know how i can get it back?

1 Like

NextCloudPi version v1.9.3
NextCloudPi image NextCloudPi_RPi_01-14-19
distribution Raspbian GNU/Linux 9.8 (stretch)
Nextcloud version 15.0.2

Hi, I have the same problem. Using the snippet it give me this output:

pi@nextcloudpi:/usr/local/etc $ sudo sh -x library.sh
+ CFGDIR=/usr/local/etc/ncp-config.d
+ BINDIR=/usr/local/bin/ncp
library.sh: 14: library.sh: Syntax error: "(" unexpected

UPDATE: I’ve updated nextcloud to 15.0.5.3, the error

/etc/letsencrypt/letsencrypt-auto: No such file or directory

remain.

what is that? that is not the code snippet

thank you @nachoparker. I think i understand the cause. But i have little experience in coding etc.
So, i did the following.
i have createt a file (“letsencrpt.sh”) in the tmp directory on the pi und put your snippet in it. than i startet it with
sudo sh /tmp/letsencrypt.sh

the result looks like this:

/tmp/letsencrypt.sh: 1: /tmp/letsencrypt.sh: source: not found
: not foundcrypt.sh: 2: /tmp/letsencrypt.sh:
/tmp/letsencrypt.sh: 3: /tmp/letsencrypt.sh: [[: not found
: not foundcrypt.sh: 3: /tmp/letsencrypt.sh: {
: not foundcrypt.sh: 4: /tmp/letsencrypt.sh:
/tmp/letsencrypt.sh: 5: /tmp/letsencrypt.sh: [[: not found
/tmp/letsencrypt.sh: 6: /tmp/letsencrypt.sh: [[: not found
Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Unable to locate package letsencrypt
E: Command line option ’
’ [from -y
] is not understood in combination with the other options.
/tmp/letsencrypt.sh: 10: /tmp/letsencrypt.sh: install_app: not found
/tmp/letsencrypt.sh: 11: /tmp/letsencrypt.sh: [[: not found
/tmp/letsencrypt.sh: 12: /tmp/letsencrypt.sh: [[: not found
: not foundcrypt.sh: 12: /tmp/letsencrypt.sh:
/tmp/letsencrypt.sh: 14: /tmp/letsencrypt.sh: [[: not found
/tmp/letsencrypt.sh: 15: /tmp/letsencrypt.sh: [[: not found
/tmp/letsencrypt.sh: 16: /tmp/letsencrypt.sh: Syntax error: “}” unexpected
cp: cannot stat ‘/etc/letsencrypt-old/archive’: No such file or directory

I do not think I did it right…

I made a mistake, sorry. this is the output of the code snippet:

Riepilogo
pi@nextcloudpi:/tmp $ sudo sh -x letsencrpt.sh
+ source /usr/local/etc/library.sh
letsencrpt.sh: 1: letsencrpt.sh: source: not found
+ [[ -f /etc/letsencrypt/certbot-auto ]]
letsencrpt.sh: 3: letsencrpt.sh: [[: not found
+ [[ -f /.docker-image ]]
letsencrpt.sh: 5: letsencrpt.sh: [[: not found
+ [[ -f /.docker-image ]]
letsencrpt.sh: 6: letsencrpt.sh: [[: not found
+ mv /etc/letsencrypt /etc/letsencrypt-old
+ rm -f /etc/letsencrypt
+ apt-get remove -y letsencrypt
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  certbot python3-acme python3-certbot python3-configargparse python3-configobj python3-josepy python3-mock python3-parsedatetime python3-pbr
  python3-requests-toolbelt python3-rfc3339 python3-tz python3-zope.component python3-zope.event python3-zope.hookable python3-zope.interface
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  letsencrypt
0 upgraded, 0 newly installed, 1 to remove and 39 not upgraded.
After this operation, 30.7 kB disk space will be freed.
(Reading database ... 42721 files and directories currently installed.)
Removing letsencrypt (0.28.0-1~deb9u1) ...
+ apt-get autoremove -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  certbot python3-acme python3-certbot python3-configargparse python3-configobj python3-josepy python3-mock python3-parsedatetime python3-pbr
  python3-requests-toolbelt python3-rfc3339 python3-tz python3-zope.component python3-zope.event python3-zope.hookable python3-zope.interface
0 upgraded, 0 newly installed, 16 to remove and 39 not upgraded.
After this operation, 4,158 kB disk space will be freed.
(Reading database ... 42717 files and directories currently installed.)
Removing certbot (0.28.0-1~deb9u1) ...
Warning: Stopping certbot.service, but it can still be activated by:
  certbot.timer
Removing python3-certbot (0.28.0-1~deb9u1) ...
Removing python3-acme (0.28.0-1~deb9u1) ...
Removing python3-configargparse (0.11.0-1) ...
Removing python3-configobj (5.0.6-2) ...
Removing python3-josepy (1.1.0-2~deb9u1) ...
Removing python3-mock (2.0.0-3) ...
Removing python3-parsedatetime (2.1-3+deb9u1) ...
Removing python3-pbr (1.10.0-1) ...
Removing python3-requests-toolbelt (0.7.0-1) ...
Removing python3-rfc3339 (1.0-4) ...
Removing python3-tz (2016.7-0.3) ...
Removing python3-zope.component (4.3.0-1) ...
Removing python3-zope.event (4.2.0-1) ...
Removing python3-zope.hookable (4.0.4-4+b1) ...
Removing python3-zope.interface (4.3.2-1) ...
Processing triggers for man-db (2.7.6.1-2) ...
+ install_app letsencrypt
letsencrpt.sh: 10: letsencrpt.sh: install_app: not found
+ [[ -f /etc/letsencrypt-old/live ]]
letsencrpt.sh: 11: letsencrpt.sh: [[: not found
+
+ [[ -f /.docker-image ]]
+ letsencrpt.sh: 14: letsencrpt.sh: [[: not found
+ [[ -f /etc/cron.weekly/letsencrypt-ncp ]]
[[ -d /etc/letsencrypt/archive ]]
letsencrpt.sh: 15: letsencrpt.sh: [[: not found
letsencrpt.sh: 12: letsencrpt.sh: [[: not found
+ cp -ravT /etc/letsencrypt-old/archive /etc/letsencrypt/archive
cp: cannot stat '/etc/letsencrypt-old/archive': No such file or directory

sudo bash letsencrypt.sh

, or you can just paste the snippet in the terminal

cc @Rude.Boy

1 Like

Thank you very much! It works! I was using the wrong command, again. :slightly_smiling_face: