Nextcloud version (24.0.4.1)
Operating system and version (Ubuntu 22.04)
Apache2 (Apache 2.4.52)
PHP version (8.1.2)
The issue
I got a domain for Nextcloud in which I wanted to use to replace the standard IP address/nextcloud thing and also to access it from the internet so that I can finally rid myself of Google’s storage scam.
Well, apparently this plan went to nought because when I got the domain and configured Nextcloud to the domain(having already set up the server’s public ip to the domain), Nextcloud became inaccessible and as such could not work anymore. Initially nextcloud did work albeit I had to do “cloudserver.com/nextcloud”, but when I sought to change it by using Virtualhost, it just messed everything up and it just refuses to work at this point.
Is this the first time you’ve seen this error?
Yes
Steps to replicate it:
Not exactly sure what else it was but this is what I did prior.
- Add personal domain to the array within nextcloud’s php config file
- Change normal nextcloud config file in “sites available” within apache2 to use a virtualhost in order to have over the internet access into server. This was for the domain.
Nextcloud log in Admin > Logging:
{"reqId":"JYFhDVTBYmPhv6YSX1wd","level":2,"time":"2022-08-29T18:23:11+00:00","remoteAddr":"192.168.a.b","user":"--","app":"no app in context","method":"GET","url":"/nextcloud/","message":"Could not detect any host in http:///nextcloud/data/htaccesstest.txt","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36","version":"","data":[]}
{"reqId":"rsLWT33pWlhy8S6gYDRL","level":2,"time":"2022-08-30T15:32:47+00:00","remoteAddr":"192.168.c.d","user":"--","app":"no app in context","method":"GET","url":"/nextcloud/index.php/csrftoken","message":"Host 192.168.c.d was not connected to because it violates local access rules","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:104.0) Gecko/20100101 Firefox/104.0","version":"24.0.4.1","data":[]}
{"reqId":"LZSs5qL8CFJck36Bw0or","level":2,"time":"2022-08-30T16:41:46+00:00","remoteAddr":"192.168.c.d","user":"--","app":"no app in context","method":"GET","url":"/nextcloud/","message":"Host 192.168.c.d was not connected to because it violates local access rules","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:104.0) Gecko/20100101 Firefox/104.0","version":"24.0.4.1","data":[]}
{"reqId":"wGnMM0fYrecRsmgXdESF","level":2,"time":"2022-08-30T16:42:56+00:00","remoteAddr":"192.168.c.d","user":"--","app":"no app in context","method":"POST","url":"/nextcloud/index.php","message":"Host 192.168.c.d was not connected to because it violates local access rules","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:104.0) Gecko/20100101 Firefox/104.0","version":"24.0.4.1","data":[]}
{"reqId":"vqdMoqn6bbqiArUgs3rc","level":3,"time":"2022-08-30T17:33:07+00:00","remoteAddr":"192.168.a.b","user":"admin","app":"index","method":"GET","url":"/nextcloud/index.php/apps/theming/img/core/filetypes/image.svg?v=0","message":"Could not create folder","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36","version":"24.0.4.1","exception":{"Exception":"OCP\\Files\\NotPermittedException","Message":"Could not create folder","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Files/AppData/AppData.php","line":156,"function":"newFolder","class":"OC\\Files\\Node\\Folder","type":"->"},{"file":"/var/www/nextcloud/apps/theming/lib/ImageManager.php","line":163,"function":"newFolder","class":"OC\\Files\\AppData\\AppData","type":"->"},{"file":"/var/www/nextcloud/apps/theming/lib/ImageManager.php","line":178,"function":"getCacheFolder","class":"OCA\\Theming\\ImageManager","type":"->"},{"file":"/var/www/nextcloud/apps/theming/lib/Controller/IconController.php","line":90,"function":"getCachedImage","class":"OCA\\Theming\\ImageManager","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":225,"function":"getThemedIcon","class":"OCA\\Theming\\Controller\\IconController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":133,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":172,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":298,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1023,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/lib/private/Files/Node/Folder.php","Line":164,"CustomMessage":"--"}}
{"reqId":"As1oBqHiTchkpIZiFk8u","level":3,"time":"2022-08-30T17:48:04+00:00","remoteAddr":"192.168.c.d","user":"admin","app":"ocs_api","method":"POST","url":"/nextcloud/ocs/v2.php/cloud/users","message":"Unable to send the invitation mail to abcdef@yahoo.com","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:104.0) Gecko/20100101 Firefox/104.0","version":"24.0.4.1","exception":{"Exception":"Swift_TransportException","Message":"Connection could not be established with host 127.0.0.1 :stream_socket_client(): Unable to connect to 127.0.0.1:25 (Connection refused)","Code":0,"Trace":[{"function":"{closure}","class":"Swift_Transport_StreamBuffer","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php","line":264,"function":"stream_socket_client"},{"file":"/var/www/nextcloud/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php","line":58,"function":"establishSocketConnection","class":"Swift_Transport_StreamBuffer","type":"->"},{"file":"/var/www/nextcloud/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php","line":143,"function":"initialize","class":"Swift_Transport_StreamBuffer","type":"->"},{"file":"/var/www/nextcloud/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift/Mailer.php","line":65,"function":"start","class":"Swift_Transport_AbstractSmtpTransport","type":"->"},{"file":"/var/www/nextcloud/lib/private/Mail/Mailer.php","line":195,"function":"send","class":"Swift_Mailer","type":"->"},{"file":"/var/www/nextcloud/apps/settings/lib/Mailer/NewUserMailHelper.php","line":184,"function":"send","class":"OC\\Mail\\Mailer","type":"->"},{"file":"/var/www/nextcloud/apps/provisioning_api/lib/Controller/UsersController.php","line":446,"function":"sendMail","class":"OCA\\Settings\\Mailer\\NewUserMailHelper","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":225,"function":"addUser","class":"OCA\\Provisioning_API\\Controller\\UsersController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":133,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":172,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":298,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/ocs/v1.php","line":62,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/ocs/v2.php","line":23,"args":["/var/www/nextcloud/ocs/v1.php"],"function":"require_once"}],"File":"/var/www/nextcloud/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php","Line":261,"message":"Unable to send the invitation mail to abcdef@yahoo.com","exception":{},"CustomMessage":"Unable to send the invitation mail to abcdef@yahoo.com"}}
{"reqId":"TggBx8tqswfN3MXCXeQE","level":2,"time":"2022-08-30T17:51:00+00:00","remoteAddr":"192.168.c.d","user":"admin","app":"core","method":"POST","url":"/nextcloud/index.php/login/confirm","message":"Login failed: 'admin' (Remote IP: '192.168.c.d')","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:104.0) Gecko/20100101 Firefox/104.0","version":"24.0.4.1","data":{"app":"core"}}
{"reqId":"Asb3hxv6AyqThIJpeV0O","level":3,"time":"2022-09-01T11:19:29+00:00","remoteAddr":"192.168.a.b","user":"MarcusDStallion","app":"index","method":"GET","url":"/nextcloud/index.php/apps/theming/img/core/filetypes/text.svg?v=0","message":"Could not create folder","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36","version":"24.0.4.1","exception":{"Exception":"OCP\\Files\\NotPermittedException","Message":"Could not create folder","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Files/AppData/AppData.php","line":156,"function":"newFolder","class":"OC\\Files\\Node\\Folder","type":"->"},{"file":"/var/www/nextcloud/apps/theming/lib/ImageManager.php","line":163,"function":"newFolder","class":"OC\\Files\\AppData\\AppData","type":"->"},{"file":"/var/www/nextcloud/apps/theming/lib/ImageManager.php","line":178,"function":"getCacheFolder","class":"OCA\\Theming\\ImageManager","type":"->"},{"file":"/var/www/nextcloud/apps/theming/lib/Controller/IconController.php","line":90,"function":"getCachedImage","class":"OCA\\Theming\\ImageManager","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":225,"function":"getThemedIcon","class":"OCA\\Theming\\Controller\\IconController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":133,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":172,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":298,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1023,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/lib/private/Files/Node/Folder.php","Line":164,"CustomMessage":"--"}}
Config PHP File for Nextcloud
<?php
$CONFIG = array (
'trusted_domains' =>
array (
0 => '192.168.x.y',
1 => 'cloudserver.com',
2 => 'a.b.c.d'
),
'datadirectory' => '/media/joswole/Windows7/JoStorage/data',
'dbtype' => 'mysql',
'check_data_directory_permissions' => false,
'version' => '24.0.4.1',
'overwrite.cli.url' => 'http://192.168.x.y/nextcloud'
'dbname' => 'clouddb',
'dbhost' => 'localhost',
'dbport' => '',
'dbtableprefix' => 'oc_',
'mysql.utf8mb4' => true,
'dbuser' => 'user',
'dbpassword' => 'Nunyabusiness445',
'installed' => true,
);
The output your Apache system log in /var/log/apache2/error.log
:
[Sat Sep 03 00:00:12.381416 2022] [mpm_prefork:notice] [pid 1026] AH00163: Apache/2.4.52 (Ubuntu) OpenSSL/3.0.2 configured -- resuming normal operations
[Sat Sep 03 00:00:12.381443 2022] [core:notice] [pid 1026] AH00094: Command line: '/usr/sbin/apache2'