Logs show missing files, but they appear to exist

Two issues that appear to be related.

  1. Every so often I get a server error that I am unable to access the site. Refreshing the page fixes this, but it is very annoying.
  2. Sometimes the page formatting is missing a lot of details, and just throws all the lines on top of each other with missing images and backgrounds.

I have two screenshots attached, let me know what other information I can provide. The way this is configured is two Linux VMs behind a load balancer with sticky connections. Web site files are stored on an NFS share that both instances have access to. They use a redis caching server for file locking and memory caching. However, the actual shared storage is on a SAMBA shared and accessed via external storage. I have no issues with that part of things.

The server shows missing files, but when I check the server filesystem I see the files mentioned. I am assuming PHP is looking for something that I am missing.

UPDATE:
Here is the log from when I had the formatting issue just now.

{“reqId”:“YABaz4nPlmFtsIvMc0S0@gAAAFg”,“level”:2,“time”:“2021-01-14T14:53:15+00:00”,“remoteAddr”:“192.168.20.47”,“user”:“6B8BE64D-431F-4423-BC45-8F9C2BCABEA0”,“app”:“core”,“method”:“GET”,“url”:"/settings/admin",“message”:“Failed to compile and/or save /var/www/html/nextcloud/core/css/server.scss”,“userAgent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36”,“version”:“20.0.4.0”,“id”:“60006812f3d3b”}

I am thinking of copying the standard web files to each instance, then mounting any shares and log directories dynamically. My theory is that one instance is maybe locking the files while the other server tries to access. But that’s just a theory.

I have updated to 20.0.5 but the problem persists. Just need a chance to move files around. Still very odd that the system complains about files not existing or being able to create them even though they exist on the filesystem.

Another issue I am running into is duplicate entries in the external storage list. When I go in to update an external storage line, I will find two of them on the page. Only one will actually make a change while the other will give me the check mark confirmation, but nothing actually changes for the storage mount. This might be related to the other issues I am facing.

Some other steps I have taken

  1. Using local memory cache instead of redis.
  2. Using only one instance instead of working behind the load balancer.

Again, I want to try running a dedicated copy of the files on each instance to see if that makes a difference. I originally did this but ran into the same problem. The only difference between then and now is that I have made other changes to how the instances run behind the LB.

So I just tried running everything (except apps, config, and data directories) directly from the instance. Still hit this “file not found” error

{“reqId”:“YCmcnVeUIOvJGD5@K7BvrgAAAIU”,“level”:3,“time”:“2021-02-14T21:56:46+00:00”,“remoteAddr”:“xxx”,“user”:“xxx”,“app”:“index”,“method”:“GET”,“url”:"/apps/files/",“message”:{“Exception”:“OCP\Files\NotFoundException”,“Message”:“File does not exist”,“Code”:0,“Trace”:[{“file”:"/var/www/html/nextcloud/lib/private/Files/SimpleFS/SimpleFile.php",“line”:94,“function”:“checkFile”,“class”:“OC\Files\SimpleFS\SimpleFile”,“type”:"->"},{“file”:"/var/www/html/nextcloud/lib/private/Template/IconsCacher.php",“line”:116,“function”:“getContent”,“class”:“OC\Files\SimpleFS\SimpleFile”,“type”:"->"},{“file”:"/var/www/html/nextcloud/lib/private/Template/SCSSCacher.php",“line”:353,“function”:“setIconsCss”,“class”:“OC\Template\IconsCacher”,“type”:"->"},{“file”:"/var/www/html/nextcloud/lib/private/Template/SCSSCacher.php",“line”:190,“function”:“cache”,“class”:“OC\Template\SCSSCacher”,“type”:"->"},{“file”:"/var/www/html/nextcloud/lib/private/Template/CSSResourceLocator.php",“line”:111,“function”:“process”,“class”:“OC\Template\SCSSCacher”,“type”:"->"},{“file”:"/var/www/html/nextcloud/lib/private/Template/CSSResourceLocator.php",“line”:86,“function”:“cacheAndAppendScssIfExist”,“class”:“OC\Template\CSSResourceLocator”,“type”:"->"},{“file”:"/var/www/html/nextcloud/lib/private/Template/ResourceLocator.php",“line”:79,“function”:“doFind”,“class”:“OC\Template\CSSResourceLocator”,“type”:"->"},{“file”:"/var/www/html/nextcloud/lib/private/TemplateLayout.php",“line”:329,“function”:“find”,“class”:“OC\Template\ResourceLocator”,“type”:"->"},{“file”:"/var/www/html/nextcloud/lib/private/TemplateLayout.php",“line”:237,“function”:“findStylesheetFiles”,“class”:“OC\TemplateLayout”,“type”:"::"},{“file”:"/var/www/html/nextcloud/lib/private/legacy/OC_Template.php",“line”:183,“function”:"__construct",“class”:“OC\TemplateLayout”,“type”:"->"},{“file”:"/var/www/html/nextcloud/lib/public/AppFramework/Http/TemplateResponse.php",“line”:210,“function”:“fetchPage”,“class”:“OC_Template”,“type”:"->"},{“file”:"/var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",“line”:123,“function”:“render”,“class”:“OCP\AppFramework\Http\TemplateResponse”,“type”:"->"},{“file”:"/var/www/html/nextcloud/lib/private/AppFramework/App.php",“line”:152,“function”:“dispatch”,“class”:“OC\AppFramework\Http\Dispatcher”,“type”:"->"},{“file”:"/var/www/html/nextcloud/lib/private/Route/Router.php",“line”:309,“function”:“main”,“class”:“OC\AppFramework\App”,“type”:"::"},{“file”:"/var/www/html/nextcloud/lib/base.php",“line”:1008,“function”:“match”,“class”:“OC\Route\Router”,“type”:"->"},{“file”:"/var/www/html/nextcloud/index.php",“line”:37,“function”:“handleRequest”,“class”:“OC”,“type”:"::"}],“File”:"/var/www/html/nextcloud/lib/private/Files/SimpleFS/SimpleFile.php",“Line”:139,“CustomMessage”:"–"},“userAgent”:“Mozilla/5.0 (Linux; Android 9; LM-V350) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.152 Mobile Safari/537.36”,“version”:“20.0.5.2”,“id”:“60299cbe91df0”}

Running out of ideas at this point.

Also have an issue with caldav not working, even after following instructions. I am wondering if this might be related.