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

in_array() expects at least 2 parameters, 1 given #14

Open
Derkades opened this issue Feb 25, 2021 · 2 comments
Open

in_array() expects at least 2 parameters, 1 given #14

Derkades opened this issue Feb 25, 2021 · 2 comments

Comments

@Derkades
Copy link

Unfortunately I don't have reproduction steps for this, hopefully just the error trace is enough.

[PHP] Error: Error: in_array() expects at least 2 parameters, 1 given at /var/www/html/apps/integration_whiteboard/lib/Service/SpacedeckAPIService.php#398 at <<closure>>

0. <<closure>>
   OC\Log\ErrorHandler::onError(2, "in_array() expe ... n", "/var/www/html/a ... p", 398, {user: "*** sens ... }})
1. /var/www/html/apps/integration_whiteboard/lib/Service/SpacedeckAPIService.php line 398
   in_array(2523546)
2. /var/www/html/lib/private/User/Manager.php line 610
   OCA\Spacedeck\Service\SpacedeckAPIService->OCA\Spacedeck\Service\{closure}("*** sensitive parameters replaced ***")
3. /var/www/html/apps/integration_whiteboard/lib/Service/SpacedeckAPIService.php line 402
   OC\User\Manager->callForSeenUsers(Closure {})
4. /var/www/html/apps/integration_whiteboard/lib/BackgroundJob/CleanupSpacedeck.php line 72
   OCA\Spacedeck\Service\SpacedeckAPIService->cleanupSpacedeckStorage("http://localhost:9666", "super_secret_token")
5. /var/www/html/lib/public/BackgroundJob/Job.php line 80
   OCA\Spacedeck\BackgroundJob\CleanupSpacedeck->run(null)
6. /var/www/html/lib/public/BackgroundJob/TimedJob.php line 61
   OCP\BackgroundJob\Job->execute(OC\BackgroundJob\JobList {}, OC\Log {})
7. /var/www/html/cron.php line 128
   OCP\BackgroundJob\TimedJob->execute(OC\BackgroundJob\JobList {}, OC\Log {})

at 2021-02-25T16:15:04+00:00
@Derkades Derkades changed the title Error in log in_array() expects at least 2 parameters, 1 given Feb 25, 2021
@tainnok
Copy link

tainnok commented Mar 21, 2021

running into the same problem.
fresh install of nextcloud 21 using docker.
only additional installed apps (using the nextcloud-UI):

  • Whiteboard integration version: 0.0.14
  • Splash version: 1.2.2

docker-compose.yml to start nextcloud

i used the template from the nextcloud-docker-example
you should be able to reproduce the error using this docker-compose.yml and installing the whiteboard-integration after startup.

version: '3'

services:
  db:
    image: mariadb
    restart: always
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
    volumes:
      - ./volumes/db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD='MYSQL_ROOT_PW'
      - MYSQL_PASSWORD='MYSQL_PW'
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud

  nextcloud:
    image: nextcloud
    restart: always
    ports:
      - 8080:80
    links:
      - db
    volumes:
      - ./volumes/nextcloud:/var/www/html
    environment:
      - MYSQL_PASSWORD='MYSQL_PW'
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
      - MYSQL_HOST=db

changes in my environment:
i use traefik as reverse-proxy, redirect http to https and use letsencrypt.
so in my config i removed the ports section an add the following lables for traefik (the domain-name is a environment set outside of the docker-compose.yml)

labels:
      - traefik.enable=true
      - traefik.http.routers.nextcloud.rule=Host(`$NEXTCLOUD_DOMAINNAME`)
      - traefik.http.routers.nextcloud.tls.certresolver=le
      - traefik.http.services.nextcloud.loadbalancer.server.port=80

Errormessage

grafik

Serverinfo in json-format

created by https://<my-nextcloud.example.com>/ocs/v2.php/apps/serverinfo/api/v1/info?format=json
info.json.log

@tainnok
Copy link

tainnok commented Mar 21, 2021

just a guess (as i am no php-developer, and i also do NOT plan to become one):
SpacedeckAPIService.php:398 should be modified as followed?:

398c398
<                               if (!in_array($wbFile->getId())) {
---
>                               if (!in_array($wbFile->getId(), $fileIds)) {

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

2 participants