Error: Undefined offset: 3 at /var/www/nextcloud/lib/private/legacy/OC_Helper.php#548

Thanks for clearing that up :slight_smile: So, we’ll have to wait for next update or add the fix manually :+1:

Yes, problem certainly still present in 20.0.1

2 Likes

It’s in 20.0.1, and it’s made Nextcloud unusable. I get errors trying to anything - get a listing of the files, or doing any action on any files throws these errors in the logs.

Is there a known date for when 20.0.2 will be released? Or is the only way this will be fixed sooner is to upgrade to a beta?

TIA.

2 Likes

Have a look on the issue ticket and the applied fix. Usually it should be possible to get the file differences displayed so that you can patch your files on your own.

4 Likes

I just applied the fix from the issue ticket, now the error is gone. Thanks @j-ed.

1 Like

For others with the issue - It’s easier to pull the entire file from the master branch (https://github.com/nextcloud/server/blob/master/lib/private/legacy/OC_Helper.php) and just replace it.

Thanks.

8 Likes

@kchoi That was the easiest solution. Thanks :blush:

thanks, it works. :crazy_face:

1 Like

Okay guys, sorry for asking, I’m new to NC. I just installed it viaweb installer of my web hoster (20.0.1). I also keep seeing this error and I understand I should replace a specific file by the version posted here: https://github.com/nextcloud/server/blob/master/lib/private/legacy/OC_Helper.php

Which file needs to be replaced by that? Could you please tell me the exact path?

Thanks and best regards
Jens

Hi Jens,
You want to replace OC_Helper.php with what is in github.

I can’t tell you the exact path, because it depends on where your web hoster installed it. The error you see in the logs will tell you the exact path of the file giving the error, so download the file from github, and upload/copy that file to the path from your logs. You may have to open a ticket with your web hoster for further assistance.

HTH.

1 Like

You need to search/replace the file ./lib/private/legacy/OC_Helper.php from your Nextcloud document root folder :wink:

1 Like

Thanks, found it and fixed it :slight_smile:

Easiest way for me was to use Total Commander to access the web server, then find the file, hit “F4”, paste the above posted code to overwrite the existing one and save it. Since then, the problem is gone.

2 Likes

The best way to find that file is to search for it:
sudo find / -name OC_Helper.php
Once you got the file location, delete it and replace with the github’s file: https://github.com/nextcloud/server/blob/master/lib/private/legacy/OC_Helper.php

Replaced “OC_Helper.php” with the version from master branch.
Now I am met with this message on nextcloud login page:

Internal Server Error

The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.

I also replaced the “OC_Helper.php” and it worked for some time.
Today i got this :frowning: :
Fatal error: Unknown: Failed opening required ‘/var/www/html/index.php’ (include_path=’.:/usr/local/lib/php’) in Unknown on line 0

I found out, that something might be wrong with my mariaDB now:


So i restarted everything and it was still there. Than i looked into the mariaDB log:

I don’t know if this caused it, but i assume this is the only thing i changed (on purpose).

Please don’t hijack a closed thread, instead open a new one and describe your problem there. Changing a php script of Nextcloud can usually not influence the database start.

1 Like

Sorry about that, i fixed it (somehow) and wanted to delete this post quickly. At least it is up and running.
Sorry :bowing_man: for disturbing the eternal slumber :slight_smile:

And thank you for the fix in the first place!

1 Like

I’ve applied the fix (overwrite OC_Helper.php from github) but I’m still having the issue. It’s made our nextcloud completely unworkable, any advice on possible next steps?

If you have a backup from the original version of OC_Helper.php, just try to put it back instead of master branch file, then edit it and add the missing lines (from 548 to 552), according to this: https://github.com/nextcloud/server/pull/23606/files/c1834bac7d39dbae43277857f6c5ae8cada891d7

Thanks for the tip but unfortunately that didn’t work either.

I’m using Fedora Linux 33, I’ve installed the desktop app and I’m able to copy files into the local directories which are sync’d up to my server. I can access these files via my browser but I can’t use my browser or android app to upload files