nextcloud / polls

🗳️ Polls app for Nextcloud
https://apps.nextcloud.com/apps/polls
GNU Affero General Public License v3.0
256 stars 73 forks source link

Error after update to 5.1.0: "BadFunctionCallException: lastInteraction is not a valid attribute" #2963

Closed juergen852 closed 1 year ago

juergen852 commented 1 year ago

⚠️ This issue respects the following points: ⚠️

What went wrong, what did you observe?

After installation, the App is unusable.

grafik

What did you expect, how polls should behave instead?

Work as before.

What steps does it need to replay this bug?

  1. Just updated the App.

Installation method

Installed/updated from the appstore (Apps section of your site)

Installation type

Updated from a minor version within same major version (i.e. 4.0.0 to 4.1.1)

Affected polls version

5.1.0

Which browser did you use, when experiencing the bug?

Other browser

No response

Which System did you use, when experiencing the bug?

Other OS

No response

Add your browser log here

No response

Additional client environment information

Ubuntu 22.04 Linux 5.15.0-75-generic x86_64 Nextcloud Hub 4 (26.0.3)

DB: Art: mysql Version: 10.8.8 Größe: 686,3 MB

PHP: Version: 8.1.13 Speicherlimit: 1 GB Maximale Ausführungszeit: 3600 Maximale Größe zum Hochladen: 10 GB Erweiterungen: Core, date, libxml, openssl, pcre, zlib, filter, hash, json, Reflection, SPL, session, standard, sodium, cgi-fcgi, mysqlnd, PDO, xml, apcu, bcmath, bz2, calendar, ctype, curl, dom, mbstring, FFI, fileinfo, ftp, gd, gettext, gmp, iconv, igbinary, imagick, intl, ldap, exif, mysqli, pdo_mysql, Phar, posix, readline, redis, shmop, SimpleXML, smbclient, sockets, sysvmsg, sysvsem, sysvshm, tokenizer, xmlreader, xmlwriter, xsl, zip, libsmbclient, Zend OPcache

NC version

Nextcloud 26 (Nextcloud Hub 4)

Other Nextcloud version

26.0.3

PHP engine version

PHP 8.1

Other PHP version

8.1.13

Database engine

MySQL

Database Engine version or other Database

No response

Which user-backends are you using?

Add your nextcloud server log here

[index] Fehler: BadFunctionCallException: lastInteraction is not a valid attribute at <<closure>>

 0. /var/www/nextcloud/lib/public/AppFramework/Db/Entity.php line 167
    OCP\AppFramework\Db\Entity->setter()
 1. /var/www/nextcloud/lib/public/AppFramework/Db/Entity.php line 75
    OCP\AppFramework\Db\Entity->__call()
 2. /var/www/nextcloud/lib/public/AppFramework/Db/QBMapper.php line 322
    OCP\AppFramework\Db\Entity::fromRow()
 3. /var/www/nextcloud/lib/public/AppFramework/Db/QBMapper.php line 340
    OCP\AppFramework\Db\QBMapper->mapRowToEntity()
 4. /var/www/nextcloud/apps/polls/lib/Db/PollMapper.php line 149
    OCP\AppFramework\Db\QBMapper->findEntities()
 5. /var/www/nextcloud/apps/polls/lib/Service/PollService.php line 129
    OCA\Polls\Db\PollMapper->findForAdmin()
 6. /var/www/nextcloud/apps/polls/lib/Controller/AdminController.php line 55
    OCA\Polls\Service\PollService->listForAdmin()
 7. /var/www/nextcloud/apps/polls/lib/Controller/BaseController.php line 55
    OCA\Polls\Controller\AdminController->OCA\Polls\Controller\{closure}("*** sensitive parameters replaced ***")
 8. /var/www/nextcloud/apps/polls/lib/Controller/AdminController.php line 55
    OCA\Polls\Controller\BaseController->response()
 9. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 230
    OCA\Polls\Controller\AdminController->list()
10. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 137
    OC\AppFramework\Http\Dispatcher->executeController()
11. /var/www/nextcloud/lib/private/AppFramework/App.php line 183
    OC\AppFramework\Http\Dispatcher->dispatch()
12. /var/www/nextcloud/lib/private/Route/Router.php line 315
    OC\AppFramework\App::main()
13. /var/www/nextcloud/lib/base.php line 1060
    OC\Route\Router->match()
14. /var/www/nextcloud/index.php line 36
    OC::handleRequest()

GET /apps/polls/administration/polls?time=1687959166016
from 10.8.2.100 by username at 2023-06-28T15:32:46+02:00

Additional environment informations

No response

Configuration report

root@cloud:/var/www/nextcloud# sudo -u www-data php occ config:list system
{
    "system": {
        "encryption.legacy_format_support": false,
        "activity_expire_days": 14,
        "allow_local_remote_servers": true,
        "auth.bruteforce.protection.enabled": true,
        "blacklisted_files": [
            ".htaccess",
            "Thumbs.db",
            "thumbs.db"
        ],
        "cron_log": true,
        "default_phone_region": "DE",
        "default_locale": "de_DE",
        "enable_previews": true,
        "enabledPreviewProviders": [
            "OC\\Preview\\PNG",
            "OC\\Preview\\JPEG",
            "OC\\Preview\\GIF",
            "OC\\Preview\\BMP",
            "OC\\Preview\\XBitmap",
            "OC\\Preview\\Movie",
            "OC\\Preview\\PDF",
            "OC\\Preview\\MP3",
            "OC\\Preview\\TXT",
            "OC\\Preview\\MarkDown"
        ],
        "filesystem_check_changes": 0,
        "filelocking.enabled": "true",
        "htaccess.RewriteBase": "\/",
        "integrity.check.disabled": false,
        "knowledgebaseenabled": false,
        "log_type": "file",
        "logfile": "\/var\/log\/nextcloud\/nextcloud.log",
        "loglevel": "2",
        "logtimezone": "Europe\/Berlin",
        "log_rotate_size": "104857600",
        "maintenance": false,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "overwriteprotocol": "https",
        "preview_max_x": 1024,
        "preview_max_y": 768,
        "preview_max_scale_factor": 1,
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0,
            "timeout": 0.5,
            "dbindex": 1
        },
        "theme": "",
        "quota_include_external_storage": false,
        "share_folder": "\/Shares",
        "skeletondirectory": "",
        "trashbin_retention_obligation": "auto, 7",
        "updater.release.channel": "stable",
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "172.16.4.2",
            "172.16.4.1",
            "cloud.domain.de",
            "cloud2.domain.de",
            "11.11.11.11",    removed sensitive IP
            "172.16.4.30",
            "docs.domain.de",
            "11.11.11.11",    removed sensitive IP
            "127.0.0.1"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "overwrite.cli.url": "https:\/\/cloud.2hv.de\/",
        "dbtype": "mysql",
        "version": "26.0.3.2",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "sendmail",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "25",
        "ldapIgnoreNamingRules": false,
        "ldapProviderFactory": "\\OCA\\User_LDAP\\LDAPProviderFactory",
        "mysql.utf8mb4": true,
        "encryption.key_storage_migrated": false,
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "remember_login_cookie_lifetime": "1800",
        "versions_retention_obligation": "auto, 365",
        "simpleSignUpLink.shown": false,
        "upgrade.disable-web": true,
        "mail_sendmailmode": "smtp",
        "app_install_overwrite": [
            "mindmap_app"
        ],
        "log.condition": {
            "apps": [
                "admin_audit"
            ]
        }
    }
}

List of activated Apps

root@cloud:/var/www/nextcloud# sudo -u www-data php occ app:list
Enabled:
  - activity: 2.18.0
  - admin_audit: 1.16.0
  - announcementcenter: 6.6.1
  - bookmarks: 13.0.1
  - bruteforcesettings: 2.6.0
  - cloud_federation_api: 1.9.0
  - comments: 1.16.0
  - contactsinteraction: 1.7.0
  - dav: 1.25.0
  - drawio: 2.1.1
  - federatedfilesharing: 1.16.0
  - federation: 1.16.0
  - files: 1.21.1
  - files_antivirus: 5.1.1
  - files_external: 1.18.0
  - files_mindmap: 0.0.28
  - files_pdfviewer: 2.7.0
  - files_rightclick: 1.5.0
  - files_sharing: 1.18.0
  - files_trashbin: 1.16.0
  - files_versions: 1.19.1
  - groupfolders: 14.0.2
  - logreader: 2.11.0
  - lookup_server_connector: 1.14.0
  - nextcloud_announcements: 1.15.0
  - notifications: 2.14.0
  - notify_push: 0.6.3
  - oauth2: 1.14.0
  - onlyoffice: 7.8.0
  - passman: 2.4.6
  - password_policy: 1.16.0
  - photos: 2.2.0
  - polls: 5.1.0
  - previewgenerator: 5.3.0
  - privacy: 1.10.0
  - provisioning_api: 1.16.0
  - recommendations: 1.5.0
  - registration: 2.2.0
  - related_resources: 1.1.0-alpha1
  - serverinfo: 1.16.0
  - settings: 1.8.0
  - sharebymail: 1.16.0
  - spreed: 16.0.4
  - support: 1.9.0
  - suspicious_login: 4.4.0
  - systemtags: 1.16.0
  - text: 3.7.2
  - theming: 2.1.1
  - twofactor_backupcodes: 1.15.0
  - twofactor_totp: 8.0.0
  - twofactor_webauthn: 1.2.0
  - updatenotification: 1.16.0
  - user_ldap: 1.16.0
  - user_status: 1.6.0
  - viewer: 1.10.0
  - weather_status: 1.6.0
  - workflowengine: 2.8.0
Disabled:
  - circles: 26.0.0 (installed 22.1.1)
  - dashboard: 7.6.0 (installed 7.1.0)
  - deck: 1.9.2 (installed 1.9.2)
  - dicomviewer: 1.2.4 (installed 1.2.4)
  - encryption: 2.14.0 (installed 2.11.0)
  - files_accesscontrol: 1.16.0 (installed 1.16.0)
  - files_automatedtagging: 1.16.1 (installed 1.16.1)
  - files_retention: 1.15.0 (installed 1.15.0)
  - firstrunwizard: 2.15.0 (installed 2.10.0)
  - passwords: 2023.6.30 (installed 2023.6.30)
  - ransomware_protection: 1.14.0 (installed 1.14.0)
  - survey_client: 1.14.0 (installed 1.9.0)
  - terms_of_service: 2.2.0 (installed 2.2.0)
  - twofactor_admin: 4.2.0 (installed 4.2.0)
  - video_converter: 1.0.5 (installed 1.0.5)
  - workflow_media_converter: 1.8.4 (installed 1.8.4)
  - workflow_pdf_converter: 1.11.0 (installed 1.11.0)

Nextcloud Signing status

No errors have been found.

Additional Information

No response

roberto-thy commented 1 year ago

I am facing the same issue

dartcafe commented 1 year ago

From which prior polls version did you update?

dartcafe commented 1 year ago

Please try to run occ polls:db:rebuild and tell me if this helped.

roberto-thy commented 1 year ago

I updated from 5.0.5. Rebuilding the database did not change the bevaior. I cannot create a new poll as well.

dartcafe commented 1 year ago

Yeah. I misinterpreted the error message. It says, there is a column last_interaction in oc_polls_polls, but it is unknown to the entity definition.

But it is there: https://github.com/nextcloud/polls/blob/aa7cba6a9c4ea6b2df97abcb342ce800850829d5/lib/Db/Poll.php#L76-L77

https://github.com/nextcloud/polls/blob/aa7cba6a9c4ea6b2df97abcb342ce800850829d5/lib/Db/Poll.php#L127

Have you tried to flush the object cache or restart the server?

I just updated a couple of productive systems without issues.

juergen852 commented 1 year ago

Rebooting solved the problem.

occ polls:db:rebuild did not help I did not know, how to flush object cache correctly, therefore I rebooted.

dartcafe commented 1 year ago

I don't know why, but there seems to be a serious problem with some caches, which cache the PHP objects. If the objects get changed, still the old version seems to be loaded. At least my experiences are, that the update ran without problems (triggered both via occ and via app store). We had a similair probmems with the update routine.

Possibly related

And finally: https://github.com/nextcloud/server/issues/38158

dartcafe commented 1 year ago

@ChristophWurst Can you tell, if this is a similar problem or a configuration issue.

Maybe, I did something wrong, but I have no idea what it could be. In the end a missing attribute is detected, but the updated code shows the attribute correctly.

roberto-thy commented 1 year ago

Yes, flushing the cache worked, thanks

dartcafe commented 1 year ago

But not satisfying anyways

ChristophWurst commented 1 year ago

If this happens in a request after the upgrade it's very strange.

It sounds like the opcache is too aggressive and doesn't refresh after code changes.

juergen852 commented 1 year ago

We had the same Cache Problem with the Passman App yesterday. After Update, it did not work any more. https://github.com/nextcloud/passman/issues/787#issuecomment-1607019046

Maybe some general Nextcloud Issue and not App-Specific.

dartcafe commented 1 year ago

It sounds like the opcache is too aggressive and doesn't refresh after code changes.

Unfortunateley I have no experience with opcache and so have no idea, how to prevent that. Is it to be expected, that the cache gets refreshed automatically or should there be some instruction to flush the cache while updating?

But as far as I understood, this resets the complete memory cache. Not sure, if this could have negative consequences for the performance or not.

dartcafe commented 1 year ago

@juergen852 For curiosity, could you check your opcache settigns against the recommendations here: https://docs.nextcloud.com/server/latest/admin_manual/installation/server_tuning.html

juergen852 commented 1 year ago

@dartcafe We have nothing with opcache.xxxx in our /var/www/nextcloud/config/config.php Where sould I look for opcache?

In /var/www/nextcloud/config/config.php we have: 'memcache.local' => '\OC\Memcache\APCu', 'memcache.locking' => '\OC\Memcache\Redis', as we run only on 1 VM.

root@cloud:~# ps ax | grep memcached 1410 ? Ssl 0:01 /usr/bin/memcached -m 64 -p 11211 -u memcache -l 127.0.0.1 45530 pts/0 S+ 0:00 grep --color=auto memcached

dartcafe commented 1 year ago

I think opcache is configured on php level, so you should check your php.ini

ChristophWurst commented 1 year ago

Unfortunateley I have no experience with opcache and so have no idea, how to prevent that. Is it to be expected, that the cache gets refreshed automatically or should there be some instruction to flush the cache while updating?

It depends on the settings. In extreme cases a web server restart is necessary. Hence the instruction to restart after an update: https://docs.nextcloud.com/server/stable/admin_manual/maintenance/manual_upgrade.html (item 13).

But as far as I understood, this resets the complete memory cache. Not sure, if this could have negative consequences for the performance or not.

Opcache != memory cace. Opcache caches PHP code (operations), not the data.

ChristophWurst commented 1 year ago

https://docs.nextcloud.com/server/stable/admin_manual/installation/server_tuning.html#enable-php-opcache for the opcache recommendations

dartcafe commented 1 year ago

But as far as I understood, this resets the complete memory cache. Not sure, if this could have negative consequences for the performance or not.

Opcache != memory cace. Opcache caches PHP code (operations), not the data.

I meant the memory cached objects. But again: I have no experience with it, so 🙊. 😄

dartcafe commented 1 year ago

i'll close this issue, but keep it pinned for a while.

github-actions[bot] commented 5 months ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.