Unable to open image files on NC22

I had written as described below, but the situation has since changed, so I will rewrite it.

I have not been able to open photo files on external storage with FTP/SFTP connection since I got my NC22. The message “Error loading XXXX.jpg” will be displayed. We are unable to display any photo files such as PNG, JPEG, BMP, etc. We can open PDF files and text-based files.

The server I specify for external storage can only be connected to via FTP or SFTP. We can’t open the file with both of these.

Is there a solution?


My NC users cannot access the external storage via SFTP. As soon as a user tries to connect to access my external storage, it goes back to the file list view screen.

We have been using NC for a long time, and the external storage (SFTP) that was set up before works fine. The problem seems to occur when adding new storage via SFTP connection. Of course, in the external storage settings, the connection to the desired directory is made without any problem. The green check mark icon is lit.

I change the connection to FTP and can set up a new connection. However, there seem to be some problems such as users not being able to open photo files on NC. In other words, we can only download external storage for new additional connections.

Is this a problem with my external storage server or with the external storage app?
I want to use SFTP because FTP transfer speed is slow, is there any workaround?


NC 22.1.0, Nginx 1.20.1, PHP 7.4.22, External Storage Support app 1.12.1

Can you use sftp directly from the nextcloud linux command line?
Can you post some logs and errors (linux sftp-client, ssh-logs, nextcloud logs, …)

I wrote that I have always had no problem with pre-configured external storage (SFTP), but users are having problems opening photos. It seems to be able to open text files, PDFs, and Excel files.

This is similar to a problem I wrote about earlier.

In the previous case, the error was output to the error log, but this time it will not be logged. And this time, users can’t open the photos via FTP instead of SFTP, just like the above topic.
I skipped NC21 and updated from NC20 to NC22. I am now on NC22.1.1. I had no problems with NC20, but it has been occurring since I went to NC22.

I’m sorry, what does this mean?

With the sftp external storage your nextcloud server connects from the server itself to the sftp-server. Can you also access the sftp server from the command line e.g.
sftp user@server.tld

I can use the sftp command to transfer files.

sftp -P XXXX username@server
> sftp> put TEST.txt
> Uploading TEST.txt to /REMOTE-SERVER/TEST.txt

Ok normally it works. That is fine.
Can you post logs from Nextcloud and logs from your sftp server (e.g. /var/log/…) while using Nextcloud with sftp?

Nextcloud:
Errors were logged during NC20 when the problem was happening, but this time they are not logged at all.

Error: file_exists(): open_basedir restriction in effect. File(/templates/) is not within the allowed path(s): (/NEXTCLOUD-PATH/:/tmp/:/dev/urandom:/proc/meminfo) at /NEXTCLOUD-PATH/lib/private/Template/Base.php#68

Error: file_exists(): open_basedir restriction in effect. File(/appinfo/routes.php) is not within the allowed path(s): (/NEXTCLOUD-PATH/:/tmp/:/dev/urandom:/proc/meminfo) at /NEXTCLOUD-PATH/lib/private/Route/Router.php#134

If I were to extract the logs that are being output, the above two errors are being output in large numbers regardless of the timing of the SFTP.

External Server:
The server used for external storage is Shared web hosting service. I’ve looked into it, but there doesn’t seem to be a way to see the logs.

I am looking for alternatives, even if they are urgent. I have Dropbox. Is there a way to share a single Dropbox account with everyone in NC22?

The external storage application that was released in the past does not seem to be available.
https://apps.nextcloud.com/apps/files_external_dropbox

No idea with Dropbox.

But if you a more space on your nextcloud server outside nextcloud you can use e.g. local
That works fine on my nextcloud server.

Why can’t I just open image files?
I wouldn’t have to resort to Dropbox if I could solve this.

I upgraded from NC20 to NC22. I would like to downgrade to NC20 but I guess that is not possible. This may not be relevant. I’m currently using PHP 7.4, is there any chance that changing to PHP 8 will fix this?

I’ve found a workaround.

Looks like “user_usage_report.app” is causing problems.
I was able to work around the problem by disabling this app.

I didn’t fully grasp the problem, because I kept my image files entirely on external storage. This problem was not related to external storage. When that app is enabled, I can’t open any image files on NC (main) storage as well.