@MyNCPi posted a new topic, subject "[Nextcloudpi] Letsencrypt Error". It read:

   Got Information from Letsencrypt
    
    _Your certificate (or certificates) for the names listed below will expire in_  
    _19 days (on 14 Dec 17 16:43 +0000). Please make sure to renew_  
    _your certificate before then, or visitors to your website will encounter errors._
    
    Running NCP - **v0.37.5**
    
    Running Command Line  
    _sudo /etc/letsencrypt/certbot-auto renew_
    
    Receive Error  
    _Illegal instruction_  
    _Error: couldn't get currently installed version for /opt/eff.org/certbot/venv/bin/letsencrypt:_  
    _Illegal instruction_
    
    And trying to enter the “letsencrypt” Directory  
    /opt/eff.org/certbot/venv/bin# ls  
    _activate certbot letsencrypt pip2.7 python-config_  
    _activate.csh easy_install pbr python unit2_  
    _activate.fish easy_install-2.7 pip python2 wheel_  
    _activate_this.py jws pip2 python2.7_
    
    cd letsencrypt  
    _bash: cd: letsencrypt: Not a directory_
    
    Updated everytime with NCP, no manual Updates via Command Line, any hint what to do?

To which @nachoparker (Nachoparker) replied

    have you tried re-running `letsencrypt` from `sudo nextcloudpi-config`, or from ncp-web?

So @MyNCPi replied

    `sudo nextcloudpi-config`
    
    _Launching letsencrypt_  
    _Illegal instruction_  
    _Error: couldn't get currently installed version for /opt/eff.org/certbot/venv/bin/letsencrypt:_  
    _Illegal instruction_  
    _Done. Press any key…_
    
    Wasnt a good idea, NCP and Nextcloud https Websites wont working :-/

@nachoparker (Nachoparker) replied

    wow, let's do something
    [code] 
        sudo rm /usr/local/etc/nextcloudpi-config.d/letsencrypt.sh
        sudo rm -rf /etc/letsencrypt
        sudo ncp-update
        
    [/code]
    
    and then try again

Then @nachoparker (Nachoparker) said

    then, please give me the output of `sudo ncp-report`. I would like to know what happened

@MyNCPi replied

    And here is my Output…
    
    `sudo rm /usr/local/etc/nextcloudpi-config.d/letsencrypt.sh`  
    `sudo rm -rf /etc/letsencrypt`  
    `sudo ncp-update`  
    Downloading updates  
    Performing updates  
    Installing letsencrypt  
    Get:1 http://archive.raspberrypi.org/debian stretch InRelease [25.3 kB]  
    Hit:2 http://mirrordirector.raspbian.org/raspbian stretch InRelease  
    Get:3 http://archive.raspberrypi.org/debian stretch/main armhf Packages [123 kB]  
    Fetched 149 kB in 3s (45.4 kB/s)  
    Reading package lists… Done  
    Reading package lists… Done  
    Building dependency tree  
    Reading state information… Done  
    python2.7-minimal is already the newest version (2.7.13-2).  
    python2.7-minimal set to manually installed.  
    0 upgraded, 0 newly installed, 0 to remove and 21 not upgraded.  
    Cloning into ‘letsencrypt'…  
    remote: Counting objects: 50746, done.  
    remote: Compressing objects: 100% (140/140), done.  
    remote: Total 50746 (delta 109), reused 104 (delta 54), pack-reused 50552  
    Receiving objects: 100% (857)322-8715), 15.86 MiB | 4.35 MiB/s, done.  
    Resolving deltas: 100% (36326/36326), done.  
    **_Illegal instruction_**  
    **_Error: couldn't get currently installed version for /opt/eff.org/certbot/venv/bin/letsencrypt:_**  
    **_Illegal instruction_**  
    NextCloudPi updated to version v0.37.5
    
    `sudo ncp-report`  
    <–! Paste this in GitHub report -->
    
    NextCloudPi diagnostics
    [code] 
        sudo: /var/www/nextcloud/occ: command not found
        
        
        
        
        NextCloudPi version  v0.37.5
        NextCloudPi image    NextCloudPi_09-12-17
        distribution         Raspbian GNU/Linux 9 \n \l
        automount            no
        USB devices          none
        datadir              /var/www/nextcloud/data
        data in SD           yes
        data filesystem      ext2/ext3
        data disk usage      3.0G/15G
        rootfs usage         3.0G/15G
        Nextcloud check      error
        HTTPD service        up
        PHP service          up
        MariaDB service      up
        Redis service        up
        Postfix service      up
        internet check       ok
        port check 80        open
        port check 443       open
        IP                   XXX
        gateway              YYY
        interface            eth0
        certificates         none
        certs due            none
        NAT loopback         no
        uptime               2days
        
        
    [/code]
    
    Nextcloud configuration
    [code] 
        sudo: /var/www/nextcloud/occ: command not found
        
        
    [/code]
    
    HTTPd logs
    [code] 
        [Mon Nov 27 06:25:03.140607 2017] [ssl:warn] [pid 820:tid 1992417280] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
        [Mon Nov 27 06:25:04.001164 2017] [mpm_event:notice] [pid 820:tid 1992417280] AH00489: Apache/2.4.25 (Raspbian) OpenSSL/1.0.2l configured -- resuming normal operations
        [Mon Nov 27 06:25:04.001282 2017] [core:notice] [pid 820:tid 1992417280] AH00094: Command line: '/usr/sbin/apache2'
        
        
    [/code]
    
    Database logs
    [code] 
        
        
    [/code]
    
    Nextcloud logs
    [code] 
        {"reqId":"WhIdMH8AAQEAADaGCtwAAABU","level":2,"time":"2017-11-20T00:09:20+00:00","remoteAddr":"(857)322-8715","user":"--","app":"core","method":"POST","url":"\/","message":"Trusted domain error. \"(857)322-8715\" tried to access using \"(857)322-8715\" as host.","userAgent":"Mozilla\/5.0 (Windows NT 6.1; WOW64; Trident\/7.0; rv:11.0) like Gecko","version":"(857)322-8715"}
        {"reqId":"WhIdqH8AAQEAADaFOjMAAAAQ","level":2,"time":"2017-11-20T00:11:20+00:00","remoteAddr":"(857)322-8715","user":"--","app":"core","method":"POST","url":"\/","message":"Trusted domain error. \"(857)322-8715\" tried to access using \"(857)322-8715\" as host.","userAgent":"Mozilla\/5.0 (Windows NT 6.1; WOW64; Trident\/7.0; rv:11.0) like Gecko","version":"(857)322-8715"}
        {"reqId":"WhIeIX8AAQEAADaFOjQAAAAG","level":2,"time":"2017-11-20T00:13:21+00:00","remoteAddr":"(857)322-8715","user":"--","app":"core","method":"POST","url":"\/","message":"Trusted domain error. \"(857)322-8715\" tried to access using \"(857)322-8715\" as host.","userAgent":"Mozilla\/5.0 (Windows NT 6.1; WOW64; Trident\/7.0; rv:11.0) like Gecko","version":"(857)322-8715"}
        {"reqId":"WhIemX8AAQEAADaGCt0AAABV","level":2,"time":"2017-11-20T00:15:22+00:00","remoteAddr":"(857)322-8715","user":"--","app":"core","method":"POST","url":"\/","message":"Trusted domain error. \"(857)322-8715\" tried to access using \"(857)322-8715\" as host.","userAgent":"Mozilla\/5.0 (Windows NT 6.1; WOW64; Trident\/7.0; rv:11.0) like Gecko","version":"(857)322-8715"}
        {"reqId":"WhIfEn8AAQEAADaGCt4AAABW","level":2,"time":"2017-11-20T00:17:22+00:00","remoteAddr":"(857)322-8715","user":"--","app":"core","method":"POST","url":"\/","message":"Trusted domain error. \"(857)322-8715\" tried to access using \"(857)322-8715\" as host.","userAgent":"Mozilla\/5.0 (Windows NT 6.1; WOW64; Trident\/7.0; rv:11.0) like Gecko","version":"(857)322-8715"}
        {"reqId":"WhIfi38AAQEAADaGCt8AAABY","level":2,"time":"2017-11-20T00:19:23+00:00","remoteAddr":"(857)322-8715","user":"--","app":"core","method":"POST","url":"\/","message":"Trusted domain error. \"(857)322-8715\" tried to access using \"(857)322-8715\" as host.","userAgent":"Mozilla\/5.0 (Windows NT 6.1; WOW64; Trident\/7.0; rv:11.0) like Gecko","version":"(857)322-8715"}
        {"reqId":"WhIgA38AAQEAADaGCuAAAABD","level":2,"time":"2017-11-20T00:21:23+00:00","remoteAddr":"(857)322-8715","user":"--","app":"core","method":"POST","url":"\/","message":"Trusted domain error. \"(857)322-8715\" tried to access using \"(857)322-8715\" as host.","userAgent":"Mozilla\/5.0 (Windows NT 6.1; WOW64; Trident\/7.0; rv:11.0) like Gecko","version":"(857)322-8715"}
        {"reqId":"WhIgfH8AAQEAADaGCuEAAABX","level":2,"time":"2017-11-20T00:23:24+00:00","remoteAddr":"(857)322-8715","user":"--","app":"core","method":"POST","url":"\/","message":"Trusted domain error. \"(857)322-8715\" tried to access using \"(857)322-8715\" as host.","userAgent":"Mozilla\/5.0 (Windows NT 6.1; WOW64; Trident\/7.0; rv:11.0) like Gecko","version":"(857)322-8715"}
        {"reqId":"WhIg9X8AAQEAADaGCuIAAABE","level":2,"time":"2017-11-20T00:25:25+00:00","remoteAddr":"(857)322-8715","user":"--","app":"core","method":"POST","url":"\/","message":"Trusted domain error. \"(857)322-8715\" tried to access using \"(857)322-8715\" as host.","userAgent":"Mozilla\/5.0 (Windows NT 6.1; WOW64; Trident\/7.0; rv:11.0) like Gecko","version":"(857)322-8715"}
        {"reqId":"WhIhbX8AAQEAADaGCuMAAABA","level":2,"time":"2017-11-20T00:27:25+00:00","remoteAddr":"(857)322-8715","user":"--","app":"core","method":"POST","url":"\/","message":"Trusted domain error. \"(857)322-8715\" tried to access using \"(857)322-8715\" as host.","userAgent":"Mozilla\/5.0 (Windows NT 6.1; WOW64; Trident\/7.0; rv:11.0) like Gecko","version":"(857)322-8715"}
        {"reqId":"WhIh5n8AAQEAADaGCuQAAABG","level":2,"time":"2017-11-20T00:29:26+00:00","remoteAddr":"(857)322-8715","user":"--","app":"core","method":"POST","url":"\/","message":"Trusted domain error. \"(857)322-8715\" tried to access using \"(857)322-8715\" as host.","userAgent":"Mozilla\/5.0 (Windows NT 6.1; WOW64; Trident\/7.0; rv:11.0) like Gecko","version":"(857)322-8715"}
        {"reqId":"WhIiX38AAQEAADaGCuUAAABB","level":2,"time":"2017-11-20T00:31:27+00:00","remoteAddr":"(857)322-8715","user":"--","app":"core","method":"POST","url":"\/","message":"Trusted domain error. \"(857)322-8715\" tried to access using \"(857)322-8715\" as host.","userAgent":"Mozilla\/5.0 (Windows NT 6.1; WOW64; Trident\/7.0; rv:11.0) like Gecko","version":"(857)322-8715"}
        {"reqId":"WhIi138AAQEAADaGCuYAAABC","level":2,"time":"2017-11-20T00:33:27+00:00","remoteAddr":"(857)322-8715","user":"--","app":"core","method":"POST","url":"\/","message":"Trusted domain error. \"(857)322-8715\" tried to access using \"(857)322-8715\" as host.","userAgent":"Mozilla\/5.0 (Windows NT 6.1; WOW64; Trident\/7.0; rv:11.0) like Gecko","version":"(857)322-8715"}
        {"reqId":"WhlVUn8AAQEAAANgXpcAAABY","level":2,"time":"2017-11-25T11:34:42+00:00","remoteAddr":"(857)322-8715","user":"--","app":"core","method":"GET","url":"\/","message":"Trusted domain error. \"(857)322-8715\" tried to access using \"(857)322-8715\" as host.","userAgent":"--","version":"(857)322-8715"}
        {"reqId":"WhpiJn8AAQEAABctBDUAAAAO","level":2,"time":"2017-11-26T06:41:42+00:00","remoteAddr":"(857)322-8715","user":"--","app":"core","method":"GET","url":"\/","message":"Trusted domain error. \"(857)322-8715\" tried to access using \"(857)322-8715\" as host.","userAgent":"Mozilla\/5.0 (Windows NT 6.3; Trident\/7.0; rv:11.0) like Gecko","version":"(857)322-8715"}
        {"reqId":"Whpoo38AAQEAABctBDkAAAAT","level":2,"time":"2017-11-26T07:09:23+00:00","remoteAddr":"(857)322-8715","user":"--","app":"core","method":"GET","url":"\/","message":"Trusted domain error. \"(857)322-8715\" tried to access using \"(857)322-8715\" as host.","userAgent":"Mozilla\/5.0 (Windows NT 10.0; WOW64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/(857)322-8715 Safari\/537.36","version":"(857)322-8715"}
        {"reqId":"WhrDTX8AAQEAABcuImYAAABD","level":3,"time":"2017-11-26T13:36:13+00:00","remoteAddr":"(857)322-8715","user":"--","app":"PHP","method":"GET","url":"\/recordings\/index.php","message":"Exception: The requested uri(\/recordings\/index.php) cannot be processed by the script '\/core\/templates\/404.php') at \/var\/www\/nextcloud\/lib\/private\/AppFramework\/Http\/Request.php#729","userAgent":"curl\/7.19.7 (x86_64-redhat-linux-gnu) libcurl\/7.19.7 NSS\/3.27.1 zlib\/1.2.3 libidn\/1.18 libssh2\/1.4.2","version":"(857)322-8715"}
        {"reqId":"WhrDTX8AAQEAABcuImcAAABL","level":3,"time":"2017-11-26T13:36:13+00:00","remoteAddr":"(857)322-8715","user":"--","app":"PHP","method":"GET","url":"\/a2billing\/admin\/Public\/index.php","message":"Exception: The requested uri(\/a2billing\/admin\/Public\/index.php) cannot be processed by the script '\/core\/templates\/404.php') at \/var\/www\/nextcloud\/lib\/private\/AppFramework\/Http\/Request.php#729","userAgent":"curl\/7.19.7 (x86_64-redhat-linux-gnu) libcurl\/7.19.7 NSS\/3.27.1 zlib\/1.2.3 libidn\/1.18 libssh2\/1.4.2","version":"(857)322-8715"}
        {"reqId":"WhrFmn8AAQEAABctCDMAAAAO","level":2,"time":"2017-11-26T13:46:02+00:00","remoteAddr":"(857)322-8715","user":"--","app":"core","method":"GET","url":"\/","message":"Trusted domain error. \"(857)322-8715\" tried to access using \"(857)322-8715\" as host.","userAgent":"--","version":"(857)322-8715"}
        {"reqId":"WhtOgH8AAQEAABctCkUAAAAP","level":3,"time":"2017-11-26T23:30:08+00:00","remoteAddr":"(857)322-8715","user":"--","app":"PHP","method":"GET","url":"\/a2billing\/common\/javascript\/misc.js","message":"Exception: The requested uri(\/a2billing\/common\/javascript\/misc.js) cannot be processed by the script '\/core\/templates\/404.php') at \/var\/www\/nextcloud\/lib\/private\/AppFramework\/Http\/Request.php#729","userAgent":"python-requests\/2.18.4","version":"(857)322-8715"}
        
        
    [/code]

@nachoparker (Nachoparker) replied

    those exact commands worked for me, plus you have some weird stuff like the occ file not found… did you do any manual changes to your system?

@MyNCPi replied

    I just added some NC Plugins via NC Webadmin and simple Cronjob for SD Card Backup to a Windows Share. Dont know what is OCC… I must Restore my SD Card to my latest Backup for a full Plugin Overview.

Then @MyNCPi said

    OK i restored my Installation and now These Plugins are activeted  
    Deleted files  
    Federation  
    File sharing  
    Log Reader  
    Log Reader  
    Monitoring  
    Nextcloud announcements  
    Notifications  
    Text editor  
    Theming  
    Update notification  
    Versions  
    Admin notifications  
    Calendar  
    Contacts  
    Group folders  
    Ransomware protection  
    Tasks

After which, @MyNCPi added

    And the NC Config.php  
    <?php  
    $CONFIG = array (  
    ‘passwordsalt' => ‘XXXX',  
    ‘secret' => ‘XXXX',  
    ‘trusted_domains' =>  
    array (  
    0 => ‘localhost',  
    1 => ‘(857)322-8715',  
    2 => ‘my.tld.com',  
    3 => ‘PiHostname',  
    ),  
    ‘datadirectory' => ‘/var/www/nextcloud/data',  
    ‘overwrite.cli.url' => ‘https://my.tld.com',  
    ‘dbtype' => ‘mysql',  
    ‘version' => ‘(857)322-8715',  
    ‘dbname' => ‘nextcloud',  
    ‘dbhost' => ‘localhost',  
    ‘dbport' => ‘',  
    ‘dbtableprefix' => ‘oc_',  
    ‘mysql.utf8mb4' => true,  
    ‘dbuser' => ‘ncadmin',  
    ‘dbpassword' => ‘ncadmin',  
    ‘installed' => true,  
    ‘instanceid' => ‘nextcloud',  
    ‘mail_smtpmode' => ‘php',  
    ‘mail_smtpauthtype' => ‘LOGIN',  
    ‘mail_from_address' => ‘spam',  
    ‘mail_domain' => ‘tld.com',  
    ‘overwriteprotocol' => ‘https',  
    ‘loglevel' => ‘2',  
    ‘log_type' => ‘file',  
    ‘default_language' => ‘de',  
    ‘knowledgebaseenabled' => false,  
    ‘enable_avatars' => false,  
    ‘allow_user_to_change_display_name' => false,  
    ‘updatechecker' => true,  
    ‘enable_previews' => false,  
    ‘maintenance' => false,  
    ‘theme' => ‘',  
    ‘memcache.local' => ‘\OC\Memcache\Redis',  
    ‘memcache.locking' => ‘\OC\Memcache\Redis',  
    ‘redis' =>  
    array (  
    ‘host' => ‘/var/run/redis/redis.sock',  
    ‘port' => 0,  
    ‘timeout' => 0.0,  
    ),  
    );

Then @nachoparker (Nachoparker) said

    Hi,
    
    I don't think this has anything to do with your Nextcloud apps, or config. This has something to do with the packages in your system and letsencrypt. I suggest you just backup, burn the latest image to the SD card and then restore your Nextcloud instance.
    
    It will probably be the fastest thing to do.

To which @MyNCPi replied

    This is what i wanted to read  Well i give it a try at the Weekend. Only Backup the Data inside Nextcloud or also something from NCP?

After which, @nachoparker (Nachoparker) added

    run `nc-backup` to save a copy of your NC instance. You can restore it with `nc-restore`.
    
    you can also export your NCP config with `nc-export-ncp` and import it later with `nc-import-ncp`
    
    I'm about to upload the latter two, so they will be available for you by the weekend

So @MyNCPi replied

    Thank you very much


{'source': 'discourse', 'url': 'https://help.nextcloud.com/t/nextcloudpi-letsencrypt-error/24012', 'title': '[Nextcloudpi] Letsencrypt Error', 'views': 1915, 'has_accepted_answer': True, 'word_count': 2317, 'like_count': 0, 'reply_count': 11, 'participant_count': 2, 'posts': 14, 'tags': 'ncp', 'author': '@MyNCPi', 'participants': '@MyNCPi, @nachoparker (Nachoparker)', 'image_url': [None], 'created_at': '2017-11-27T08:20:51.272Z', 'last_posted_at': '2017-11-27T18:43:34.005Z'}