Unable to upload files

In September I uploaded some new documents (terms and conditions) in recurring invoices and this worked without any issues. Now after some updates I need to update some files because I adjusted my prices, but unfortunately I get an error message:

Error: please check that Invoice Ninja v5 is installed on the server

Laravel.log

[2022-12-04 06:27:43] production.ERROR: The "" file does not exist or is not readable. {"userId":1,"exception":"[object] (Symfony\\Component\\Mime\\Exception\\InvalidArgumentException(code: 0): The \"\" file does not exist or is not readable. at /var/www/invoiceninja/vendor/symfony/mime/FileinfoMimeTypeGuesser.php:50)
[stacktrace]
#0 /var/www/invoiceninja/vendor/symfony/mime/MimeTypes.php(134): Symfony\\Component\\Mime\\FileinfoMimeTypeGuesser->guessMimeType()
#1 /var/www/invoiceninja/vendor/symfony/http-foundation/File/File.php(77): Symfony\\Component\\Mime\\MimeTypes->guessMimeType()
#2 /var/www/invoiceninja/vendor/symfony/http-foundation/File/File.php(59): Symfony\\Component\\HttpFoundation\\File\\File->getMimeType()
#3 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Http/FileHelpers.php(50): Symfony\\Component\\HttpFoundation\\File\\File->guessExtension()
#4 /var/www/invoiceninja/app/Jobs/Util/UploadFile.php(87): Illuminate\\Http\\UploadedFile->hashName()
#5 /var/www/invoiceninja/app/Utils/Traits/SavesDocuments.php(48): App\\Jobs\\Util\\UploadFile->handle()
#6 /var/www/invoiceninja/app/Http/Controllers/RecurringInvoiceController.php(773): App\\Http\\Controllers\\RecurringInvoiceController->saveDocuments()
#7 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): App\\Http\\Controllers\\RecurringInvoiceController->upload()
#8 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(43): Illuminate\\Routing\\Controller->callAction()
#9 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Routing/Route.php(260): Illuminate\\Routing\\ControllerDispatcher->dispatch()
#10 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Routing/Route.php(205): Illuminate\\Routing\\Route->runController()
#11 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Routing/Router.php(725): Illuminate\\Routing\\Route->run()
#12 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}()
#13 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(126): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#14 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(62): Illuminate\\Routing\\Middleware\\ThrottleRequests->handleRequest()
#15 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Routing\\Middleware\\ThrottleRequests->handle()
#16 /var/www/invoiceninja/app/Http/Middleware/QueryLogging.php(39): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#17 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): App\\Http\\Middleware\\QueryLogging->handle()
#18 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(50): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#19 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Routing\\Middleware\\SubstituteBindings->handle()
#20 /var/www/invoiceninja/app/Http/Middleware/Locale.php(46): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#21 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): App\\Http\\Middleware\\Locale->handle()
#22 /var/www/invoiceninja/app/Http/Middleware/TokenAuth.php(96): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#23 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): App\\Http\\Middleware\\TokenAuth->handle()
#24 /var/www/invoiceninja/app/Http/Middleware/SetDb.php(40): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#25 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): App\\Http\\Middleware\\SetDb->handle()
#26 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#27 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Routing/Router.php(726): Illuminate\\Pipeline\\Pipeline->then()
#28 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Routing/Router.php(703): Illuminate\\Routing\\Router->runRouteWithinStack()
#29 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Routing/Router.php(667): Illuminate\\Routing\\Router->runRoute()
#30 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Routing/Router.php(656): Illuminate\\Routing\\Router->dispatchToRoute()
#31 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(190): Illuminate\\Routing\\Router->dispatch()
#32 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}()
#33 /var/www/invoiceninja/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Http/SetRequestIpMiddleware.php(45): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#34 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Sentry\\Laravel\\Http\\SetRequestIpMiddleware->handle()
#35 /var/www/invoiceninja/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Http/SetRequestMiddleware.php(31): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#36 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Sentry\\Laravel\\Http\\SetRequestMiddleware->handle()
#37 /var/www/invoiceninja/vendor/livewire/livewire/src/DisableBrowserCache.php(19): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#38 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Livewire\\DisableBrowserCache->handle()
#39 /var/www/invoiceninja/app/Http/Middleware/Cors.php(25): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#40 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): App\\Http\\Middleware\\Cors->handle()
#41 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php(39): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#42 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Http\\Middleware\\TrustProxies->handle()
#43 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#44 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#45 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull->handle()
#46 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#47 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#48 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\TrimStrings->handle()
#49 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#50 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle()
#51 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#52 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle()
#53 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#54 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(165): Illuminate\\Pipeline\\Pipeline->then()
#55 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(134): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter()
#56 /var/www/invoiceninja/public/index.php(57): Illuminate\\Foundation\\Http\\Kernel->handle()
#57 {main}
"} 

Anyone having the same issue? I already tried to upload another document to make sure it hasn’t got anything to do with the file itself.

@david do you have any suggestions?

For this error, is this you trying to download or upload a file?

I’m trying to upload documents. Downloading is no issue and I am also able to delete them.

@nvlitsolutions

Can you describe your environment more? it looks like the files are not making it all the way through to the app and are getting blocked somewhere.

My setup looks like this:
nginx proxy server → apache webserver

Os: Ubuntu 22.04
Control panel: ISPConfig.
Invoice Ninja: v5.5.45-C102

Yesterday I updated invoice ninja on command line with the commands described on the website:
git pull
composer install
php artisan ninja:post-update

Those commands were executed with the web user to make sure permissions are correct.

I also tried adding a document via the API, but without success:
POST to https://xxxxxxxxxxxxxx/api/v1/recurring_invoices/xxxxxxxxx/upload

Headers:
Content-Type: multipart/form-data
X-Requested-With: XMLHttpRequest
X-API-Secret: mysecret
X-Api-Token: mytoken

Body:
documents: /mypath/to/document.pdf
_method: PUT

Proxy server vhost:

server {
        listen x.x.x.x:80;        
        listen x.x.x.x:443 ssl http2;

	ssl_protocols TLSv1.3 TLSv1.2;        
        ssl_certificate xxxxxxxxxxxxxxxxxxx;
        ssl_certificate_key xxxxxxxxxxxxxxxxxxxxx;

        server_name xxxxxxxxxxxxxxxxxxxxxxx;

        root   xxxxxxxxxxxxxxxxxxxx;
		disable_symlinks if_not_owner from=$document_root;

        if ($scheme != "https") {
            rewrite ^(?!/\.well-known/acme-challenge)/ https://$http_host$request_uri? permanent;
        }
        if ($http_host != "xxxxxxxxxxxxxxxxxxxx") {
            rewrite ^(?!/\.well-known/acme-challenge)/ $scheme://xxxxxxxxxxxxxxxxxxxx$request_uri? permanent;
        }

        location ~ /\.(?!well-known/acme-challenge/) {
		deny all;
		access_log off;
		log_not_found off;
        }

        location ~ /\.well-known/acme-challenge/ {
		root /usr/local/ispconfig/interface/acme/;
		index index.html index.htm;
		try_files $uri =404;
        }

        location / {
            proxy_pass http://xxxxxxxxxxxxxxxxxxxx;
                    proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header Upgrade           $http_upgrade;
        proxy_set_header Connection        "upgrade";
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_read_timeout 600s;
        proxy_buffer_size 64k;
        proxy_buffers 8 64k;
        proxy_busy_buffers_size 64k;
        client_max_body_size 20M;



        }
}

Webserver vhost:

<Directory /var/www/xxxxxxxxxxxxxx>
		AllowOverride None
				Require all denied
		</Directory>

<VirtualHost *:80>


					DocumentRoot xxxxxxxxxxxxxxxxxxxxxxx
			
		ServerName xxxxxxxxxxxxxxxxxxx
		ServerAdmin xxxxxxxxxxxxxxxxxxxxxxx


		ErrorLog /var/log/ispconfig/httpd/xxxxxxxxxxxxxxxxxxxxxxxx/error.log

		Alias /error/ "/var/www/xxxxxxxxxxxxxxxxxxxxxxxxxx/web/error/"
		ErrorDocument 400 /error/400.html
		ErrorDocument 401 /error/401.html
		ErrorDocument 403 /error/403.html
		ErrorDocument 404 /error/404.html
		ErrorDocument 405 /error/405.html
		ErrorDocument 500 /error/500.html
		ErrorDocument 502 /error/502.html
		ErrorDocument 503 /error/503.html


		<Directory /var/www/xxxxxxxxxxxxxxxxxxxxxxxxxxxx/web>
				# Clear PHP settings of this website
				<FilesMatch ".+\.ph(p[345]?|t|tml)$">
						SetHandler None
				</FilesMatch>
				Options +SymlinksIfOwnerMatch
				AllowOverride All
								Require all granted
						</Directory>
		<Directory /var/www/clients/xxxxxx/xxxxxxxxxxxx/web>
				# Clear PHP settings of this website
				<FilesMatch ".+\.ph(p[345]?|t|tml)$">
						SetHandler None
				</FilesMatch>
				Options +SymlinksIfOwnerMatch
				AllowOverride All
								Require all granted
						</Directory>




		# suexec enabled
		<IfModule mod_suexec.c>
			SuexecUserGroup xxxxxxxxxx xxxxxxxxxxxxxxxx
		</IfModule>
		<IfModule mod_fastcgi.c>
				<Directory /var/www/clients/xxxxxxxxxxxxxxx/xxxxxxxxxxxxxxx/cgi-bin>
										Require all granted
								    </Directory>
				<Directory /var/www/xxxxxxxxxxxxxxxxxx/web>
					<FilesMatch "\.php[345]?$">
						<If "-f '%{REQUEST_FILENAME}'">
							SetHandler php-fcgi
						</If>
					</FilesMatch>
				</Directory>
				<Directory /var/www/clients/xxxxxxxxxxx/xxxxxxxxxxxxxx/web>
					<FilesMatch "\.php[345]?$">
						<If "-f '%{REQUEST_FILENAME}'">
							SetHandler php-fcgi
						</If>
					</FilesMatch>
				</Directory>
                Action php-fcgi /php-fcgi virtual
				Alias /php-fcgi /var/www/clients/xxxxxxxxxxxxxxx/xxxxxxxxxxxxx/cgi-bin/php-fcgi-*-80-xxxxxxxxxxxxxxxxxxxx
                FastCgiExternalServer /var/www/clients/xxxxxxxxxxxxx/xxxxxxxxxxxx/cgi-bin/php-fcgi-*-80-xxxxxxxxxxxxxxxx -idle-timeout 300 -socket /var/run/php/xxxxxx.sock -pass-header Authorization  -pass-header Content-Type
		</IfModule>
		<IfModule mod_proxy_fcgi.c>
			#ProxyPassMatch ^/(.*\.php[345]?(/.*)?)$ unix:///var/run/php/xxxxxxxxxxxx.sock|fcgi://localhost//var/www/clients/xxxxxxxxx/xxxxxxxxxxxxxxx/web/$1
			<Directory /var/www/clients/xxxxxxxxx/xxxxxxxxxxx/web>
				<FilesMatch "\.php[345]?$">
					<If "-f '%{REQUEST_FILENAME}'">
						SetHandler "proxy:unix:/var/run/php/xxxxxxxxxxxxx.sock|fcgi://localhost"
					</If>
				</FilesMatch>
			</Directory>
			</IfModule>



		# add support for apache mpm_itk
		<IfModule mpm_itk_module>
			AssignUserId xxxxxx xxxxxxxxxx
		</IfModule>

		<IfModule mod_dav_fs.c>
		# Do not execute PHP files in webdav directory
			<Directory /var/www/clients/xxxxxxxxxxxxxx/xxxxxxxxx/webdav>
				<ifModule mod_security2.c>
					SecRuleRemoveById 960015
					SecRuleRemoveById 960032
				</ifModule>
				<FilesMatch "\.ph(p3?|tml)$">
					SetHandler None
				</FilesMatch>
			</Directory>
			DavLockDB /var/www/clients/xxxxxxxxxx/xxxxxxxxxxxx/tmp/DavLock
			# DO NOT REMOVE THE COMMENTS!
			# IF YOU REMOVE THEM, WEBDAV WILL NOT WORK ANYMORE!
      # WEBDAV BEGIN
			# WEBDAV END
		</IfModule>

			
	

</VirtualHost>

Just updated to v5.5.47-C102 today. Can no longer upload.
I’m running Self-Hosted in Docker. Was able to upload documents just yesterday or day before.
What happens is after selecting the file from my explorer window the file doesnt appear. The site is also un-interactable for a few seconds (just giving me a Windows chime sound whenever I click on the site).

Nginx, mysql

Any update on this? Meanwhile I noticed several updates of the application, but unfortunately they didn’t solve my issue.

Could it be related to my webserver setups? Any configuration I’m missing at nginx or Apache? It did work in the past, so therefore I didn’t looked in that direction.