Unable to open files with internal CODE Server

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 20.0.5): 25.0.1
Operating system and version (eg, Ubuntu 20.04): Ubuntu 20.04.5 LTS
Apache or nginx version (eg, Apache 2.4.25): 2.4.41
PHP version (eg, 7.4): 7.4.3

The issue you are facing:
After Updating NC to 25.0.1 I can’t open office files in the browser anymore. Instead I can only download them. I’m using the builtin CODE Server with Collabora. If I check administration settings / Nextcloud Office it shows a green icon saying the server is availble. As soon as I click on “use builtin code server” again, the green icon changes to red saying that its not possible to connect to the server.

Is this the first time you’ve seen this error? Yes

Steps to replicate it:

The output of your Nextcloud log in Admin > Logging:

[richdocuments] Fehler: GuzzleHttp\Exception\RequestException: cURL error 60: SSL certificate problem: unable to get local issuer certificate (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://nc.DOMAIN.de/apps/richdocumentscode/proxy.php?req=/hosting/capabilities at <<closure>>

 0. /var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php line 158
    GuzzleHttp\Handler\CurlFactory::createRejection()
 1. /var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php line 110
    GuzzleHttp\Handler\CurlFactory::finishError()
 2. /var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Handler/CurlHandler.php line 47
    GuzzleHttp\Handler\CurlFactory::finish()
 3. /var/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php line 113
    GuzzleHttp\Handler\CurlHandler->__invoke()
 4. /var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php line 35
    OC\Http\Client\DnsPinMiddleware->OC\Http\Client\{closure}("*** sensitive parameters replaced ***")
 5. /var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php line 31
    GuzzleHttp\PrepareBodyMiddleware->__invoke()
 6. /var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php line 71
    GuzzleHttp\Middleware::GuzzleHttp\{closure}("*** sensitive parameters replaced ***")
 7. /var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php line 63
    GuzzleHttp\RedirectMiddleware->__invoke()
 8. /var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/HandlerStack.php line 75
    GuzzleHttp\Middleware::GuzzleHttp\{closure}("*** sensitive parameters replaced ***")
 9. /var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php line 331
    GuzzleHttp\HandlerStack->__invoke()
10. /var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php line 168
    GuzzleHttp\Client->transfer()
11. /var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php line 187
    GuzzleHttp\Client->requestAsync()
12. /var/www/nextcloud/lib/private/Http/Client/Client.php line 218
    GuzzleHttp\Client->request()
13. /var/www/nextcloud/apps/richdocuments/lib/Service/CapabilitiesService.php line 131
    OC\Http\Client\Client->get()
14. /var/www/nextcloud/apps/richdocuments/lib/Service/CapabilitiesService.php line 74
    OCA\Richdocuments\Service\CapabilitiesService->refetch()
15. /var/www/nextcloud/apps/richdocuments/lib/AppInfo/Application.php line 80
    OCA\Richdocuments\Service\CapabilitiesService->getCapabilities()
16. /var/www/nextcloud/lib/private/AppFramework/Bootstrap/FunctionInjector.php line 67
    OCA\Richdocuments\AppInfo\Application->OCA\Richdocuments\AppInfo\{closure}("*** sensitive parameters replaced ***")
17. /var/www/nextcloud/lib/private/AppFramework/Bootstrap/BootContext.php line 51
    OC\AppFramework\Bootstrap\FunctionInjector->injectFn()
18. /var/www/nextcloud/apps/richdocuments/lib/AppInfo/Application.php line 135
    OC\AppFramework\Bootstrap\BootContext->injectFn()
19. /var/www/nextcloud/lib/private/AppFramework/Bootstrap/Coordinator.php line 190
    OCA\Richdocuments\AppInfo\Application->boot()
20. /var/www/nextcloud/lib/private/legacy/OC_App.php line 208
    OC\AppFramework\Bootstrap\Coordinator->bootApp()
21. /var/www/nextcloud/lib/private/legacy/OC_App.php line 141
    OC_App::loadApp()
22. /var/www/nextcloud/cron.php line 55
    OC_App::loadApps()

at 2022-11-07T12:50:01+01:00

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'passwordsalt' => '***',
  'secret' => '***',
  'trusted_domains' => 
  array (
    0 => 'localhost',
    1 => '192.168.0.26',
    2 => 'nextcloud500gb',
    3 => 'nc.DOMAIN.de',
  ),
  'trusted_proxies' => 
  array (
    0 => '192.168.0.1',
  ),
  'overwritecondaddr' => '^192\\.168\\.0\\.1$',
  'datadirectory' => '/mnt/ncdata',
  'dbtype' => 'pgsql',
  'version' => '25.0.1.1',
  'overwrite.cli.url' => 'https://nextcloud500gb/',
  'dbname' => 'nextcloud_db',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'ncadmin',
  'dbpassword' => '***',
  'installed' => true,
  'instanceid' => 'ocznrofiis2f',
  'upgrade.disable-web' => true,
  'log_type' => 'file',
  'logfile' => '/var/log/nextcloud/nextcloud.log',
  'loglevel' => '2',
  'log.condition' => 
  array (
    'apps' => 
    array (
      0 => 'admin_audit',
    ),
  ),
  'allow_local_remote_servers' => true,
  'mail_smtpmode' => 'smtp',
  'remember_login_cookie_lifetime' => '1800',
  'log_rotate_size' => '0',
  'trashbin_retention_obligation' => 'auto, 60',
  'versions_retention_obligation' => 'auto, 180',
  'activity_expire_days' => '120',
  'simpleSignUpLink.shown' => false,
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'filelocking.enabled' => true,
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => '/var/run/redis/redis-server.sock',
    'port' => 0,
    'timeout' => 0.5,
    'dbindex' => 0,
    'password' => '@Eu3i0qCRHqSHs0ODQBtCecZWpTiS',
  ),
  'default_phone_region' => 'de',
  'logtimezone' => 'Europe/Berlin',
  'htaccess.RewriteBase' => '/',
  'maintenance' => false,
  'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
  'mail_from_address' => 'nextcloud',
  'mail_sendmailmode' => 'smtp',
  'mail_domain' => 'DOMAIN.de',
  'mail_smtphost' => 'mailgw.DOMAIN.de',
  'updater.release.channel' => 'stable',
  'mail_smtpport' => '25',
);

The output of your Apache log in /var/log/____:

[Mon Nov 07 00:00:23.332453 2022] [ssl:warn] [pid 1224:tid 140707675917376] AH01909: 127.0.1.1:443:0 server certificate does NOT include an ID which matches the server name
[Mon Nov 07 00:00:23.332890 2022] [mpm_event:notice] [pid 1224:tid 140707675917376] AH00489: Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f configured -- resuming normal operations
[Mon Nov 07 00:00:23.332897 2022] [core:notice] [pid 1224:tid 140707675917376] AH00094: Command line: '/usr/sbin/apache2'
[Mon Nov 07 08:51:20.354407 2022] [proxy_fcgi:error] [pid 60971:tid 140707508791040] [client 192.168.0.139:53407] AH01067: Failed to read FastCGI header
[Mon Nov 07 08:51:20.354443 2022] [proxy_fcgi:error] [pid 60971:tid 140707508791040] (104)Connection reset by peer: [client 192.168.0.139:53407] AH01075: Error dispatching request to : 
[Mon Nov 07 08:51:20.401484 2022] [proxy_fcgi:error] [pid 60971:tid 140707584325376] [client 192.168.0.137:53764] AH01067: Failed to read FastCGI header
[Mon Nov 07 08:51:20.401512 2022] [proxy_fcgi:error] [pid 60971:tid 140707584325376] (104)Connection reset by peer: [client 192.168.0.137:53764] AH01075: Error dispatching request to : 
[Mon Nov 07 08:51:20.408801 2022] [proxy_fcgi:error] [pid 60971:tid 140707450017536] [client 192.168.0.137:53764] AH01067: Failed to read FastCGI header
[Mon Nov 07 08:51:20.413141 2022] [proxy_fcgi:error] [pid 60971:tid 140707416413952] [client 192.168.0.139:53407] AH01067: Failed to read FastCGI header
[Mon Nov 07 08:51:20.549935 2022] [mpm_event:notice] [pid 1224:tid 140707675917376] AH00491: caught SIGTERM, shutting down
[Mon Nov 07 08:52:38.722361 2022] [ssl:warn] [pid 1232:tid 140122716118080] AH01909: 127.0.1.1:443:0 server certificate does NOT include an ID which matches the server name
[Mon Nov 07 08:52:38.740310 2022] [ssl:warn] [pid 1293:tid 140122716118080] AH01909: 127.0.1.1:443:0 server certificate does NOT include an ID which matches the server name
[Mon Nov 07 08:52:38.741319 2022] [mpm_event:notice] [pid 1293:tid 140122716118080] AH00489: Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f configured -- resuming normal operations
[Mon Nov 07 08:52:38.741331 2022] [core:notice] [pid 1293:tid 140122716118080] AH00094: Command line: '/usr/sbin/apache2'
[Mon Nov 07 08:52:38.955688 2022] [proxy:error] [pid 1294:tid 140122490218240] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /run/php/php7.4-fpm.nextcloud.sock (*) failed
[Mon Nov 07 08:52:38.955713 2022] [proxy_fcgi:error] [pid 1294:tid 140122490218240] [client 192.168.0.139:53561] AH01079: failed to make connection to backend: httpd-UDS
[Mon Nov 07 09:07:43.321390 2022] [proxy_fcgi:error] [pid 1294:tid 140122498619136] [client 192.168.0.137:54103] AH01067: Failed to read FastCGI header
[Mon Nov 07 09:07:43.321451 2022] [proxy_fcgi:error] [pid 1294:tid 140122498619136] (104)Connection reset by peer: [client 192.168.0.137:54103] AH01075: Error dispatching request to : 
[Mon Nov 07 09:07:43.351767 2022] [proxy_fcgi:error] [pid 1294:tid 140122490218240] [client 192.168.0.139:53561] AH01067: Failed to read FastCGI header
[Mon Nov 07 09:07:43.351820 2022] [proxy_fcgi:error] [pid 1294:tid 140122490218240] (104)Connection reset by peer: [client 192.168.0.139:53561] AH01075: Error dispatching request to : 
[Mon Nov 07 09:07:43.368515 2022] [proxy_fcgi:error] [pid 1294:tid 140122515420928] [client 192.168.0.139:53561] AH01067: Failed to read FastCGI header
[Mon Nov 07 09:07:43.608674 2022] [mpm_event:notice] [pid 1293:tid 140122716118080] AH00491: caught SIGTERM, shutting down
[Mon Nov 07 09:09:06.248148 2022] [ssl:warn] [pid 1201:tid 140259952995392] AH01909: 127.0.1.1:443:0 server certificate does NOT include an ID which matches the server name
[Mon Nov 07 09:09:06.305197 2022] [ssl:warn] [pid 1240:tid 140259952995392] AH01909: 127.0.1.1:443:0 server certificate does NOT include an ID which matches the server name
[Mon Nov 07 09:09:06.311862 2022] [mpm_event:notice] [pid 1240:tid 140259952995392] AH00489: Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f configured -- resuming normal operations
[Mon Nov 07 09:09:06.311888 2022] [core:notice] [pid 1240:tid 140259952995392] AH00094: Command line: '/usr/sbin/apache2'
[Mon Nov 07 12:12:11.629752 2022] [proxy_fcgi:error] [pid 1248:tid 140259710293760] [client 10.8.0.4:64285] AH01071: Got error 'PHP message: {"reqId":"JPuWDnkmPBaQWOAYgNe8","level":3,"time":"2022-11-07T11:12:11+00:00","remoteAddr":"10.8.0.4","user":"--","app":"PHP","method":"GET","url":"/ocs/v2.php/apps/notifications/api/v2/notifications","message":"OCP\\\\HintException: Configuration was not read or initialized correctly, not overwriting /var/www/nextcloud/config/config.php at /var/www/nextcloud/lib/private/Config.php#266","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 Edg/107.0.1418.35","version":"","data":{"app":"PHP"}}'
[Mon Nov 07 12:12:12.617472 2022] [proxy_fcgi:error] [pid 1247:tid 140259802654464] [client 192.168.0.139:53676] AH01071: Got error 'PHP message: {"reqId":"hHJwqe8LqLotIRvaMRIL","level":3,"time":"2022-11-07T11:12:12+00:00","remoteAddr":"192.168.0.139","user":"--","app":"PHP","method":"GET","url":"/ocs/v2.php/apps/spreed/api/v3/signaling/ko9k8u3a","message":"OCP\\\\HintException: Configuration was not read or initialized correctly, not overwriting /var/www/nextcloud/config/config.php at /var/www/nextcloud/lib/private/Config.php#266","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 Edg/107.0.1418.35","version":"","data":{"app":"PHP"}}'
[Mon Nov 07 12:12:23.359382 2022] [proxy_fcgi:error] [pid 1247:tid 140259802654464] [client 192.168.0.139:53676] AH01071: Got error 'PHP message: {"reqId":"vlkLoOLnz8zSQOm4q0fV","level":3,"time":"2022-11-07T11:12:23+00:00","remoteAddr":"192.168.0.139","user":"--","app":"PHP","method":"GET","url":"/ocs/v2.php/apps/spreed/api/v3/signaling/ko9k8u3a","message":"OCP\\\\HintException: Configuration was not read or initialized correctly, not overwriting /var/www/nextcloud/config/config.php at /var/www/nextcloud/lib/private/Config.php#266","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 Edg/107.0.1418.35","version":"","data":{"app":"PHP"}}'
[Mon Nov 07 12:12:28.298597 2022] [proxy_fcgi:error] [pid 1247:tid 140259802654464] [client 192.168.0.139:53676] AH01071: Got error 'PHP message: {"reqId":"1g0WlsVXksBmCYhN4K8Y","level":3,"time":"2022-11-07T11:12:28+00:00","remoteAddr":"192.168.0.139","user":"--","app":"PHP","method":"GET","url":"/ocs/v2.php/apps/spreed/api/v4/room/ko9k8u3a/participants?includeStatus=true","message":"OCP\\\\HintException: Configuration was not read or initialized correctly, not overwriting /var/www/nextcloud/config/config.php at /var/www/nextcloud/lib/private/Config.php#266","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 Edg/107.0.1418.35","version":"","data":{"app":"PHP"}}'
[Mon Nov 07 12:16:38.334659 2022] [proxy_fcgi:error] [pid 1247:tid 140259727095552] [client 192.168.0.139:58073] AH01067: Failed to read FastCGI header
[Mon Nov 07 12:16:38.334694 2022] [proxy_fcgi:error] [pid 1247:tid 140259727095552] (104)Connection reset by peer: [client 192.168.0.139:58073] AH01075: Error dispatching request to : 
[Mon Nov 07 12:16:38.383082 2022] [proxy_fcgi:error] [pid 1247:tid 140259836225280] [client 192.168.0.178:54608] AH01067: Failed to read FastCGI header
[Mon Nov 07 12:16:38.383109 2022] [proxy_fcgi:error] [pid 1247:tid 140259836225280] (104)Connection reset by peer: [client 192.168.0.178:54608] AH01075: Error dispatching request to : 
[Mon Nov 07 12:16:38.525931 2022] [proxy_fcgi:error] [pid 1247:tid 140259802654464] [client 192.168.0.178:54608] AH01067: Failed to read FastCGI header
[Mon Nov 07 12:16:38.547601 2022] [proxy_fcgi:error] [pid 1247:tid 140259676690176] [client 192.168.0.139:58073] AH01067: Failed to read FastCGI header
[Mon Nov 07 12:16:38.680516 2022] [mpm_event:notice] [pid 1240:tid 140259952995392] AH00491: caught SIGTERM, shutting down
[Mon Nov 07 12:17:37.134504 2022] [ssl:warn] [pid 1177:tid 139631972170816] AH01909: 127.0.1.1:443:0 server certificate does NOT include an ID which matches the server name
[Mon Nov 07 12:17:37.185950 2022] [ssl:warn] [pid 1231:tid 139631972170816] AH01909: 127.0.1.1:443:0 server certificate does NOT include an ID which matches the server name
[Mon Nov 07 12:17:37.189229 2022] [mpm_event:notice] [pid 1231:tid 139631972170816] AH00489: Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f configured -- resuming normal operations
[Mon Nov 07 12:17:37.189246 2022] [core:notice] [pid 1231:tid 139631972170816] AH00094: Command line: '/usr/sbin/apache2'

Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

See above “The output of your Nextcloud log in Admin > Logging:” every couple of seconds.

Meine Nextcloud läuft seit heute früh komischerweise wieder ganz normal und die Dokumente lassen sich wieder öffnen. Ich habe keine Änderungen gemacht, deshalb habe ich leider keinen Lösungsvorschlag.
Thema kann geschlossen werden!

Beste Grüße
Jochen

Es war vielleicht ein Zertifikatsproblem. Vielleicht war ein Zertifikat zwischenzeitlich abgelaufen und wurde nun automatisch verlängert. Bei Interesse kannst du ja noch mal in die Richtung suchen.

Maybe it was a certificate problem. Perhaps a certificate had expired in the meantime and was now automatically renewed. If you are interested, you can search in this direction again.

1 Like

This issue comes when using snakeoil certs or using HTTPS on localhost.

the solution is to go to nextcloud office settings where you had the green check for build-in Code server. select custom server or own server. A URL should already be filled something like “https://localhost/nextcloud/apps/richdocumentscode_arm64/proxy.php?req=” select the disable cert validation box below it. then select the build-in Code server again.

it should tell you it’s setting up the server and finish with a green check.

ps. besides this you know you have errors in your php-fpm configuration.

1 Like

Thanks for your reply Vincent!
Honestly I didn’t realize there was an error. You’re probably talking about this:

[Mon Nov 07 08:52:38.955688 2022] [proxy:error] [pid 1294:tid 140122490218240] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /run/php/php7.4-fpm.nextcloud.sock (*) failed

Do you have an idea what causes this error and what I should do to fix it?

Best
Jochen

yes and yes

I assume the build-in code server is working?

you have assigned this missing file

; The address on which to accept FastCGI requests.
; Valid syntaxes are:
listen = /run/php/php7.4-fpm.sock

default in /etc/php/7.4/fpm/pool.d/www.conf

you should check whether your php-fpm is running

service php7.4-fpm status

if php7.4-fpm is running

ls /run/php/

you should find by default php7.4-fpm.pid and php7.4-fpm.sock

this is the fpm setup. you probably have a pointer in your website conf located in /etc/apache2/sites-available/your-website.conf

<FilesMatch ".+\.ph(ar|p|tml)$">
        SetHandler "proxy:unix:/run/php/php7.4-fpm.sock|fcgi://localhost"
    </FilesMatch>

I think here you will find that it points to php7.4-fpm.nextcloud.sock
you should correct it and point to the one found in /run/php/ or correct your pool to open a socket.

Hey Vincent,

thanks again for your detailed reply. I followed your guide but I found it to be a little different.

The command

ls /run/php/

returns

php7.4-fpm.nextcloud.sock php7.4-fpm.pid

In /etc/apache2/sites-available/your-website.conf i find:

    <FilesMatch "\.php$">
        SetHandler "proxy:unix:/run/php/php7.4-fpm.nextcloud.sock|fcgi://localhost"
    </FilesMatch>

So this appears to be right, doesn’t it?

Kind regards,
Jochen

Yes that looks fine.

trace your fpm log to see what is happening.