Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ownCloud 8.1: php-error Array to string conversion #17468

Closed
BenS89 opened this issue Jul 8, 2015 · 59 comments
Closed

ownCloud 8.1: php-error Array to string conversion #17468

BenS89 opened this issue Jul 8, 2015 · 59 comments

Comments

@BenS89
Copy link

BenS89 commented Jul 8, 2015

Steps to reproduce:

  1. Upgrade from 8.0.5 to 8.1
  2. Open the admin-panel in the web-frontend
  3. Look into the logfiles

Expected behaviour:
No errors

Actual behaviour:
You can see the following error everytime the admin-panel is requested:

Error PHP Array to string conversion at /share/MD0_DATA/Web/owncloud/lib/private/template/functions.php#36

Enabled apps:
Calendar 0.7.0
Contacts 0.4.0.0

PHP-Version: 5.5.25
OS: Embedded QNAP-Linux

@oparoz
Copy link
Contributor

oparoz commented Jul 8, 2015

It would be good if you could find out which app triggers that error.

@oparoz oparoz added the Type:Bug label Jul 8, 2015
@BenS89
Copy link
Author

BenS89 commented Jul 8, 2015

This error occurs everytime the admin-panel is shown in the web-frontend. Calendar and Contacts are not involved. If I open the admin panel 5 times, you can find 5 error-entries in the log.

@sebastianbrosch
Copy link

sebastianbrosch commented Jul 9, 2015

Exactly same issue here, but with additional line on log (every time with the same time):

is_dir(): open_basedir restriction in effect. File(/usr/bin/ffmpeg) is not within the allowed path(s): (/home/www/webXX/html:/home/www/webXX:/usr/bin/convert:/usr/bin/ffmpeg:/usr/share/php:/tmp) at /home/www/webXX/html/xxxxxxx.xxxxxxxxxxx.xx/3rdparty/symfony/process/Symfony/Component/Process/ExecutableFinder.php#59

@raimund-schluessler
Copy link
Contributor

Same error here when accessing admin settings panel.

@libasys
Copy link
Contributor

libasys commented Jul 10, 2015

confirmed! Comes from the updater section this line is to check btw that function about version:

<p style="display: none;" id="update-info" ng-show="hasUpdate" ng-init="newVersion='Array'">
<strong class="ng-binding">Es ist eine neue Version verfügbar: Array</strong>
</p>
ng-init="newVersion='Array'

@PVince81
Copy link
Contributor

Do you all have open_basedir ? Or is it something different ?

@BenS89
Copy link
Author

BenS89 commented Jul 10, 2015

I only have

Error PHP Array to string conversion at /share/MD0_DATA/Web/owncloud/lib/private/template/functions.php#36

No open_basedir errors on my side.

@PVince81
Copy link
Contributor

Does anyone have the full stack trace ? It might appear if you have xdebug enabled.

@BenS89
Copy link
Author

BenS89 commented Jul 10, 2015

I changed the loglevel to debug, but then I only get this:

{"reqId":"6yx0sTPgVsMl0lGn58VC","remoteAddr":"213.95.x.x","app":"PHP","message":"Array to string conversion at /share/MD0_DATA/Web/owncloud/lib/private/template/functions.php#36","level":3,"time":"2015-07-10T11:38:35+00:00","method":"GET","url":"/owncloud/index.php/settings/admin"}

What do you mean with "xdebug enabled"?

@PVince81
Copy link
Contributor

There is a PHP module called XDebug. It is usually used for debugging but also expands error messages to full stack traces instead of just one line.

I tried going to the admin page on my server and don't see any message. I also have OC 8.1, calendar, contacts and encryption. But don't have the updater app.

@libasys pointed out that it might come from the updater app. @BenS89 do you have it enabled ?

@VicDeo any idea ?

@BenS89
Copy link
Author

BenS89 commented Jul 10, 2015

Since I use an embedded QNAP Linux, I only can install PHP modules explicitely compiled for my NAS. Therefore, I am not able to use XDebug.

@BenS89
Copy link
Author

BenS89 commented Jul 13, 2015

@libasys Since you can reproduce this, could you provide a full stacktrace?

@tony5
Copy link

tony5 commented Jul 13, 2015

it seems that the error go's away if you do not have any Security & setup warnings.
as soon as I fixed Strict-Transport-Security the admin page no longer gives the error.

hope it helps,
take care

@BenS89
Copy link
Author

BenS89 commented Jul 13, 2015

Ok, I have two security & setup warnings which cannot be fixed so easy because of this here: #17449

The other one states that I have no php memory cache configured. Therefore, I cannot validate your post. But indeed, it seems like this is caused by the security-check component.

@raimund-schluessler
Copy link
Contributor

Indeed, this error does not occur if all warnings are fixed.

@tony5
Copy link

tony5 commented Jul 13, 2015

Ben, take a look here. https://doc.owncloud.org/server/8.1/admin_manual/installation/source_installation.html and read the section about Apache Web Server Configuration.
( AllowOverride All)
php memory cache is configured in your config.php and depending on you php version.
for php 5.4 setup php-apc and for php 5.5 setup opcache and apcu.

take care

@ghost ghost mentioned this issue Jul 14, 2015
@BenS89
Copy link
Author

BenS89 commented Jul 15, 2015

So it seems like this error is produced by the security & setup warning component. Is it planned to fix this error message?

@MorrisJobke
Copy link
Contributor

From #17782 :

bildschirmfoto von 2015-08-03 11-40-12

@shoutcast2
Copy link

I am getting the same consistent error since upgrading to 8.1.. I have also fixed all my security and setup warnings and yet I am still getting the error upon every refresh of the admin page

Error PHP Array to string conversion at /var/www/html/owncloud/lib/private/template/functions.php#36

@BenS89
Copy link
Author

BenS89 commented Aug 23, 2015

I can confirm this.

@szepeviktor
Copy link
Contributor

I had to use @ in front of print-s.

@szepeviktor
Copy link
Contributor

...which is not a solution.

@shoutcast2
Copy link

If i disable the updater app it does go away but I would like the updater app to run.. anyway to fix this

@MorrisJobke
Copy link
Contributor

cc @VicDeo

@MorrisJobke
Copy link
Contributor

@LukasReschke It doesn't really accept arrays: #8188

@MatteoMora
Copy link

@jamesfawcett
Copy link

@boyan-sharic I've resolved adding this lines: Fixes: Error PHP Array to string conversion at .../oc/lib/private/template/functions.php#36 #18921

I can confirm that @boyan-sharic 's fix above fixed the bug for me, I applied the changes to my install of ownCloud 8.2.2 (stable) in functions.php

@zyrill
Copy link

zyrill commented Feb 15, 2016

That was a workaround that I wrote that doesn't fix the underlying bug - only the symptoms. The real problem is not the function I fixed breaking, the real problem is the function getting wrong input in the first place. It could be argued that both could be changed: make the function anticipate faulty input and serialise it - and fix the original problem. On the other hand: why bog down code with exception handling that shouldn't be necessary in the first place? Either way: I really wish the problem would be fixed soon.

@MorrisJobke
Copy link
Contributor

@jamesfawcett Which app do you have enabled?

@GJSchaller
Copy link

I'm still seeing this in 8.2.2 - All setup errors are fixed, except Memory Caching (a limitation of my host's capabilities), but the error is persisting when I refresh the admin page.

@BenS89
Copy link
Author

BenS89 commented Mar 9, 2016

Fixed for me in ownCloud 9.0

@PVince81
Copy link
Contributor

PVince81 commented Mar 9, 2016

@GJSchaller 8.2.3 is out, maybe more luck there ? 😉
Some fixes from 9.0 were backported to 8.2.3.

@GJSchaller
Copy link

GJSchaller commented Mar 9, 2016 via email

@tony5
Copy link

tony5 commented Mar 10, 2016

if you do not have any setup errors / warnings on the admin page make sure the users have an email address set in the personal section of the admin panel.

@aronovgj
Copy link

Error is still there in 8.2.3. I worked around it with the script from here: #17468 (comment)

@tony5
Copy link

tony5 commented Mar 11, 2016

I am not 100% positive what causes the error disabling the updater app is one way to make it stop.
for me fixing the admin page setup errors and completing the configuration in the admin settings (user email etc) under personal makes the error stop.

even with OC 9.0 I get allot of errors in the logs until the admin page is setup correctly. after a completed configuration all errors stop for me. so I would say double check all the admin page settings and see if it helps before editing code. just a thought.

@ghost
Copy link

ghost commented Mar 25, 2016

I keep seeing this error even in OC 8.2.3.

@Siedlerchr
Copy link

Seeing this in OC 8.2.3, too.

@RexDiablo
Copy link

Since I updated from OC 8.2.2 to 8.2.3 I have the same issue. Before the update all works fine for me - no errors.

@PVince81 PVince81 reopened this Mar 30, 2016
@PVince81
Copy link
Contributor

Looks like owncloud/updater#109 is still open @VicDeo

@VicDeo you mention a fix required in core ?

@PVince81 PVince81 added this to the 8.2.4-current-maintenance milestone Mar 30, 2016
@ghost ghost modified the milestones: 8.2.5-next-maintenance, 8.2.4-current-maintenance Apr 19, 2016
@MorrisJobke MorrisJobke modified the milestones: 8.2.5, 8.2.6-current-maintenance May 17, 2016
@PVince81
Copy link
Contributor

PVince81 commented Jun 2, 2016

Is this still happening in 8.2.5 or 9.0.2 ?

@GJSchaller
Copy link

It appears fixed in 8.2.5. I am not on 9.0.2 yet.

@PVince81
Copy link
Contributor

PVince81 commented Jun 6, 2016

Ok thanks. I'm closing this now.

If anyone still sees this in a recent version, feel free to reopen. Thanks!

@PVince81 PVince81 closed this as completed Jun 6, 2016
@lock lock bot locked as resolved and limited conversation to collaborators Feb 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests