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

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.

1 Like

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.

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

it’s not use to replace the file because then you can’t login anymore with CSRF error message after having filed your credentials.

For myself, I just added the missing lines into the old file. Everything works now, the error doesn’t appear anymore in logs.

@praetorian do you stop the process before or not? if yes which one ?

No, I didn’t. Just a holly reboot after editing.

@praetorian well I can’t do that I think because I’m on a VPS.

@boistordu I think you can do a sudo reboot on VPS.

yeah but it s VPS specific nextcloud so I can’t or I need to ask them to reboot the process but can’t reboot the vps server itself.

Ok, so it’s better if someone from the team can name the processes used by nextcloud.

update 20.02 is public and online

1 Like