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

error in logs, expects array gets string #115

Closed
lamixer opened this issue Feb 4, 2017 · 11 comments
Closed

error in logs, expects array gets string #115

lamixer opened this issue Feb 4, 2017 · 11 comments

Comments

@lamixer
Copy link

lamixer commented Feb 4, 2017

Steps to reproduce

Not sure, view Activity in Nextcloud web interface might be required

Expected behaviour

No errors generated in logs

Actual behaviour

repeating log entries of:

{"reqId":"WJN8MMfkBQuqbm1itlhfCQAAAAo","remoteAddr":"myremoteIP","app":"PHP","message":"reset() expects parameter 1 to be array, string given at \/var\/www\/html\/nextcloud\/apps\/files\/lib\/Activity\/Provider.php#250","level":3,"time":"2017-02-02T18:36:35+00:00","method":"GET","url":"\/nextcloud\/index.php\/apps\/activity\/api\/v2\/activity\/by?format=json&previews=true&since=0","user":"admin","version":"11.0.1.2"}

{"reqId":"WJN8MMfkBQuqbm1itlhfCQAAAAo","remoteAddr":"myremoteIP","app":"PHP","message":"key() expects parameter 1 to be array, string given at \/var\/www\/html\/nextcloud\/apps\/files\/lib\/Activity\/Provider.php#251","level":3,"time":"2017-02-02T18:36:35+00:00","method":"GET","url":"\/nextcloud\/index.php\/apps\/activity\/api\/v2\/activity\/by?format=json&previews=true&since=0","user":"admin","version":"11.0.1.2"}

Server configuration

Operating system:
Centos 7

Web server:
Apache

Database:
Maria

PHP version:
5.6

Nextcloud version: (see Nextcloud admin page)
11.0.1

Where did you install Nextcloud from:
ZIP from Nextcloud web downloads

Signing status:
"No errors have been found."

List of activated apps:
Enabled:

  • activity: 2.4.1
  • admin_audit: 1.1.0
  • comments: 1.1.0
  • dav: 1.1.1
  • federatedfilesharing: 1.1.1
  • federation: 1.1.1
  • files: 1.6.1
  • files_pdfviewer: 1.0.1
  • files_sharing: 1.1.1
  • files_texteditor: 2.2
  • files_trashbin: 1.1.0
  • files_videoplayer: 1.0.0
  • logreader: 2.0.0
  • lookup_server_connector: 1.0.0
  • nextcloud_announcements: 1.0
  • notifications: 1.0.1
  • password_policy: 1.1.0
  • provisioning_api: 1.1.0
  • serverinfo: 1.1.1
  • sharebymail: 1.0.1
  • survey_client: 0.1.5
  • systemtags: 1.1.3
  • templateeditor: 0.2
  • theming: 1.1.1
  • twofactor_backupcodes: 1.0.0
  • updatenotification: 1.1.1
  • workflowengine: 1.1.1
    Disabled:
  • encryption
  • external
  • files_accesscontrol
  • files_automatedtagging
  • files_external
  • files_retention
  • files_versions
  • firstrunwizard
  • gallery
  • user_external
  • user_ldap
  • user_saml

The content of config/config.php:
prefer not to post unless needed

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...
No

Client configuration

Browser:
Firefox 51.0.1

Operating system:
OS X 10.12.3

@nickvergessen
Copy link
Member

Can you please execute the following query on your database, to provide a bit more details?

SELECT `subject`
FROM `oc_activity`
WHERE `subjectparams` NOT LIKE '%}]'
    AND `subjectparams` NOT LIKE '[{%'
    AND `app` = 'files'
GROUP BY `subject`

@nickvergessen
Copy link
Member

Seems to be related to nextcloud/server#3344 just want to make sure it's only the same entries.

@lamixer
Copy link
Author

lamixer commented Feb 7, 2017

Ok, database operations are not my forte, and I don't know what you are looking for, so see if this is what you wanted me to do:

MariaDB [owncloud]> SELECT `subject` FROM `oc_activity` WHERE `subjectparams` NOT LIKE '%}]'  AND `subjectparams` NOT LIKE '[{%' AND `app` = 'files' GROUP BY `subject`;
+--------------+
| subject      |
+--------------+
| changed_by   |
| changed_self |
| created_by   |
| created_self |
| deleted_by   |
| deleted_self |
+--------------+
6 rows in set (0.56 sec)

@nickvergessen
Copy link
Member

Thats good, thanks!

@nickvergessen
Copy link
Member

Can you make the following change and see if that fixes your issue?
nextcloud/server@c031c77

@lamixer
Copy link
Author

lamixer commented Feb 7, 2017

Note, my 11.0.1 installation (database / config file) was updated from OC8.2.2 to OC8.2.9 then NC9.something then NC10.0.3 then NC11.0.1

@lamixer
Copy link
Author

lamixer commented Feb 7, 2017

I can try it later today, thanks...

@lamixer
Copy link
Author

lamixer commented Feb 7, 2017

Ok, I patched my file (by hand!) looking at the diff in github, I think I did it correctly, but maybe for next time please tell me how to get a copy of the complete file with your pull request incorporated. Unfortunately the result is not what we hoped for. Upon loading the Activity page in the web interface, I now get this error, repeated:

{"reqId":"WJnxlAaiGR061yT36sOm8wAAAAU","remoteAddr":"myremoteIP","app":"PHP","message":"key() expects parameter 1 to be array, string given at \/var\/www\/html\/nextcloud\/apps\/files_sharing\/lib\/Activity\/Providers\/PublicLinks.php#216","level":3,"time":"2017-02-07T16:11:01+00:00","method":"GET","url":"\/nextcloud\/index.php\/apps\/activity\/api\/v2\/activity\/all?format=json&previews=true&since=0","user":"me","version":"11.0.1.2"}

{"reqId":"WJnxlAaiGR061yT36sOm8wAAAAU","remoteAddr":"myremoteIP","app":"PHP","message":"String offset cast occurred at \/var\/www\/html\/nextcloud\/apps\/files_sharing\/lib\/Activity\/Providers\/PublicLinks.php#218","level":3,"time":"2017-02-07T16:11:01+00:00","method":"GET","url":"\/nextcloud\/index.php\/apps\/activity\/api\/v2\/activity\/all?format=json&previews=true&since=0","user":"me","version":"11.0.1.2"}

@lamixer
Copy link
Author

lamixer commented Feb 7, 2017

need to patch another file also, I guess???

@nickvergessen
Copy link
Member

Can you try to put the following files into apps/files_sharing/lib/Activity/Providers:
Providers.zip

@lamixer
Copy link
Author

lamixer commented Feb 9, 2017

Works perfectly now, thank you!

@MorrisJobke MorrisJobke added this to the Nextcloud 12.0 milestone Feb 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants