julien-nc / cospend-nc

💰 💲hared budget manager Nextcloud app
GNU Affero General Public License v3.0
213 stars 29 forks source link

Fehler: BadFunctionCallException: deleted is not a valid attribute at <> #239

Closed stoamandl closed 7 months ago

stoamandl commented 7 months ago

Error after Update to 1.5.12 Since the last update, every user who wants to create an bill gets the following message. Ausgabe konnte nicht erstellt werden:

Diese Anwendung benötigt JavaScript zum ordnungsgemäßen Betrieb. Bitte aktiviere JavaScript und lade die Seite neu.

Interner Serverfehler Der Server konnte die Anfrage nicht fertig stellen. Sollte dies erneut auftreten, sende bitte die nachfolgenden technischen Einzelheiten an deinen Server-Administrator. Weitere Details können im Server-Protokoll gefunden werden.

Technische Details

Entfernte Adresse: xxx.xxx.xx.xxx Anfragekennung: xxxxxxxxxxxxxxxxxx

As an admin, I see the following error in the logs: [index] Fehler: BadFunctionCallException: deleted is not a valid attribute at <>

  1. /home/binaryfour/domains/cloud.binaryfour.de/public_html/lib/public/AppFramework/Db/Entity.php line 167 OCP\AppFramework\Db\Entity->setter()
  2. /home/binaryfour/domains/cloud.binaryfour.de/public_html/lib/public/AppFramework/Db/Entity.php line 75 OCP\AppFramework\Db\Entity->__call()
  3. /home/binaryfour/domains/cloud.binaryfour.de/public_html/lib/public/AppFramework/Db/QBMapper.php line 321 OCP\AppFramework\Db\Entity::fromRow()
  4. /home/binaryfour/domains/cloud.binaryfour.de/public_html/apps/cospend/lib/Db/BillMapper.php line 45 OCP\AppFramework\Db\QBMapper->mapRowToEntity()
  5. /home/binaryfour/domains/cloud.binaryfour.de/public_html/apps/cospend/lib/Controller/PageController.php line 858 OCA\Cospend\Db\BillMapper->find()
  6. /home/binaryfour/domains/cloud.binaryfour.de/public_html/lib/private/AppFramework/Http/Dispatcher.php line 230 OCA\Cospend\Controller\PageController->webAddBill()
  7. /home/binaryfour/domains/cloud.binaryfour.de/public_html/lib/private/AppFramework/Http/Dispatcher.php line 137 OC\AppFramework\Http\Dispatcher->executeController()
  8. /home/binaryfour/domains/cloud.binaryfour.de/public_html/lib/private/AppFramework/App.php line 183 OC\AppFramework\Http\Dispatcher->dispatch()
  9. /home/binaryfour/domains/cloud.binaryfour.de/public_html/lib/private/Route/Router.php line 315 OC\AppFramework\App::main()
  10. /home/binaryfour/domains/cloud.binaryfour.de/public_html/lib/base.php line 1068 OC\Route\Router->match()
    1. /home/binaryfour/domains/cloud.binaryfour.de/public_html/index.php line 36 OC::handleRequest()

POST /index.php/apps/cospend/projects/weltreise/bills

But the Bill is created! If i try to delete the bill you see the same error in Browser, but the bill is not deleted and the log show the same error .

Server configuration detail

Operating system: Linux 5.4.0-165-generic #182-Ubuntu SMP Mon Oct 2 19:43:28 UTC 2023 x86_64

Webserver: Apache (fpm-fcgi)

Database: mysql 8.0.34

PHP version: 8.2.12

Modules loaded: Core, date, libxml, openssl, pcre, zlib, filter, hash, json, random, Reflection, SPL, session, standard, sodium, cgi-fcgi, mysqlnd, PDO, xml, apcu, bcmath, bz2, calendar, ctype, curl, dom, mbstring, FFI, fileinfo, ftp, gd, gettext, gmp, gnupg, iconv, igbinary, imagick, intl, ldap, exif, memcache, mysqli, pdo_mysql, Phar, posix, readline, redis, shmop, SimpleXML, sockets, ssh2, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, xmlreader, xmlwriter, xsl, zip, Zend OPcache

Nextcloud version: 27.1.4 - 27.1.4.1

Updated from an older Nextcloud/ownCloud or fresh install:

Where did you install Nextcloud from: unknown

Signing status
List of activated apps Enabled: - activity: 2.19.0 - admin_audit: 1.17.0 - analytics: 4.11.1 - announcementcenter: 6.7.0 - appointments: 1.15.4 - approval: 1.1.0 - bookmarks: 13.1.1 - bruteforcesettings: 2.7.0 - calendar: 4.6.0 - circles: 27.0.1 - cloud_federation_api: 1.10.0 - cloud_py_api: 0.1.8 - comments: 1.17.0 - contacts: 5.4.2 - contactsinteraction: 1.8.0 - cospend: 1.5.12 - dashboard: 7.7.0 - dav: 1.27.0 - deck: 1.11.2 - drawio: 2.1.4 - federatedfilesharing: 1.17.0 - federation: 1.17.0 - files: 1.22.0 - files_external: 1.19.0 - files_fulltextsearch: 27.0.1 - files_fulltextsearch_tesseract: 27.0.0 - files_pdfviewer: 2.8.0 - files_reminders: 1.0.0 - files_rightclick: 1.6.0 - files_sharing: 1.19.0 - files_trashbin: 1.17.0 - files_versions: 1.20.0 - firstrunwizard: 2.16.0 - fulltextsearch: 27.0.2 - fulltextsearch_elasticsearch: 27.0.4 - impersonate: 1.14.0 - logreader: 2.12.0 - lookup_server_connector: 1.15.0 - maps: 1.1.1 - mediadc: 0.3.7 - metadata: 0.19.0 - news: 24.0.0 - nextcloud_announcements: 1.16.0 - notifications: 2.15.0 - oauth2: 1.15.1 - password_policy: 1.17.0 - passwords: 2023.11.30 - photos: 2.3.0 - privacy: 1.11.0 - provisioning_api: 1.17.0 - quota_warning: 1.18.0 - recommendations: 1.6.0 - related_resources: 1.2.0 - richdocuments: 8.2.3 - richdocumentscode: 23.5.503 - serverinfo: 1.17.0 - settings: 1.9.0 - sharebymail: 1.17.0 - snappymail: 2.29.4 - spreed: 17.1.3 - support: 1.10.0 - survey_client: 1.15.0 - suspicious_login: 5.0.0 - systemtags: 1.17.0 - text: 3.8.0 - theming: 2.2.0 - timemanager: 0.3.9 - timetracker: 0.0.80 - twofactor_backupcodes: 1.16.0 - twofactor_totp: 9.0.0 - updatenotification: 1.17.0 - user_status: 1.7.0 - viewer: 2.1.0 - weather_status: 1.7.0 - workflow_pdf_converter: 1.12.0 - workflowengine: 2.9.0 Disabled: - app_api: 1.1.0 - dicomviewer: 1.2.5 - encryption - fulltextsearch_old - mail: 3.4.3 - talk_matterbridge: 1.26.0 - user_ldap
Configuration (config/config.php) { "instanceid": "***REMOVED SENSITIVE VALUE***", "passwordsalt": "***REMOVED SENSITIVE VALUE***", "secret": "***REMOVED SENSITIVE VALUE***", "trusted_domains": [ "cloud.binaryfour.de" ], "datadirectory": "***REMOVED SENSITIVE VALUE***", "dbtype": "mysql", "version": "27.1.4.1", "overwrite.cli.url": "https:\/\/cloud.binaryfour.de", "dbname": "***REMOVED SENSITIVE VALUE***", "dbhost": "***REMOVED SENSITIVE VALUE***", "dbport": "", "dbtableprefix": "oc_", "mysql.utf8mb4": true, "dbuser": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "installed": true, "memcache.local": "OC\\Memcache\\APCu", "filelocking.enabled": "true", "memcache.locking": "OC\\Memcache\\Redis", "redis": { "host": "***REMOVED SENSITIVE VALUE***", "port": 6379, "password": "***REMOVED SENSITIVE VALUE***", "timeout": 0 }, "tempdirectory": "\/home\/binaryfour\/domains\/cloud.binaryfour.de\/tmp\/nextcloudtemp", "app_install_overwrite": [ "timetracker", "spreed", "deck", "files_fulltextsearch", "dicomviewer", "talk_matterbridge", "fulltextsearch", "fulltextsearch_elasticsearch", "files_fulltextsearch_tesseract", "impersonate" ], "maintenance": false, "mail_smtpmode": "smtp", "mail_smtpsecure": "tls", "mail_sendmailmode": "smtp", "mail_from_address": "***REMOVED SENSITIVE VALUE***", "mail_domain": "***REMOVED SENSITIVE VALUE***", "mail_smtpauthtype": "PLAIN", "mail_smtpauth": 1, "mail_smtphost": "***REMOVED SENSITIVE VALUE***", "mail_smtpport": "587", "mail_smtpname": "***REMOVED SENSITIVE VALUE***", "mail_smtppassword": "***REMOVED SENSITIVE VALUE***", "updater.release.channel": "stable", "versions_retention_obligation": "auto, 30", "theme": "", "loglevel": 3, "default_phone_region": "DE", "enable_previews": true, "preview_max_x": 8096, "preview_max_y": 8096, "preview_max_filesize_image": 50, "preview_libreoffice_path": "\/usr\/bin\/libreoffice", "preview_office_cl_parameters": " --headless --nologo --nofirststartwizard --invisible --norestore --convert-to png --outdir ", "enabledPreviewProviders": [ "OC\\Preview\\PNG", "OC\\Preview\\JPEG", "OC\\Preview\\GIF", "OC\\Preview\\BMP", "OC\\Preview\\XBitmap", "OC\\Preview\\MP3", "OC\\Preview\\TXT", "OC\\Preview\\MarkDown", "OC\\Preview\\OpenDocument", "OC\\Preview\\Krita" ] }

Cron Configuration: Array ( [backgroundjobs_mode] => cron [lastcron] => 1701736568 )

External storages: yes

External storage configuration +----------+-----------------------+-----------+---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+------------------+-------------------+-------+ | Mount ID | Mount Point | Storage | Authentication Type | Configuration | Options | Applicable Users | Applicable Groups | Type | +----------+-----------------------+-----------+---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+------------------+-------------------+-------+ | 2 | /ContaboObjectStorage | Amazon S3 | Zugangsschlüssel | bucket: "cloud.binaryfour.de", hostname: "xxxxxxxx.com", port: "443", region: "European Union", use_ssl: true, use_path_style: false, legacy_auth: false, key: "***", secret: "***" | enable_sharing: true, filesystem_check_changes: 0 | xxx | | Admin | +----------+-----------------------+-----------+---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+------------------+-------------------+-------+

Encryption: no

User-backends:

OC\User\Database

Talk configuration:

STUN servers

vps-two.binaryfour.de:3478

TURN servers

turn:vps-two.binaryfour.de:3478 - udp,tcp

Signaling servers (mode: default):

no custom server configured

Browser: Mozilla/5.0 (X11; Linux x86_64; rv:120.0) Gecko/20100101 Firefox/120.0

julien-nc commented 7 months ago

Thanks for the detailed bug report.

Can you check if the deleted column is there in the oc_cospend_bills table? You can do that by running this SQL query and check the column names:

SELECT * FROM oc_cospend_bills LIMIT 1;

If it's not there, something went wrong when updating Cospend. Do you remember if you had an error while updating it?

To run the relevant migration again you can run this occ command:

sudo -u www-data php /NC_PATH/occ migrations:execute cospend 010511Date20231012151740

And then check again if the deleted column exists.

stoamandl commented 7 months ago

Hi @julien-nc , the column deleted is there. All rows have "0" as value. Update was running via web update and with no errors.

I am also using the Android App MoneyBuster to add bills. The app also reports this missing "JavaScript". The annoying thing is that the app doesn't realize that the entry you just made is still there. Every time you open or refresh the app, the same entry is written again and again. In the app, however, you only ever see the error message and that the entry is pending. In the NC APP itself you then have 20 duplicates like me.

I also tried to delete old entries without success. I get this error message and the invoice remains there. Also in the database, the Deleted column of the invoice still has a 0

julien-nc commented 7 months ago

Can you check that the cospend/lib/Db/Bill.php file contains the following lines?

The only way I could reproduce your error is by deleting those lines.

How did you update Cospend? With the app settings web interface? Is it possible that some files are still in a previous state?

Something else that is weird: In the exception trace you get, it mentions PageController.php line 858 but the actual line where the BillMapper->find() method is called in v1.5.12 is 882.

stoamandl commented 7 months ago

Both lines are there. I have also checked all folders and files. All have the date of the update as the changed date.

Update.... By writing this..... i found the solution. I have had problems with various apps after an update in the past. Every now and then it has helped to restart the php-fpm.service. This is also the case here. It still had the old files in the cache and simply didn't throw them away and reload them after the update. I have also opcache running. Maybe i should check the settings to avoid future problems.

Thank you for the quick response and help! :smile:

julien-nc commented 7 months ago

You're welcome.

It has happened to me as well that php-fpm cached php files content and did not update the cache when files have actually changed on disk. I don't remember how i made this issue go away.

I'm interested to know if you find out what really was the cause and how you prevented it.

stoamandl commented 7 months ago

I found in my /etc/php/8.2/fpm/php.ini that Parameter opcache.validate_timestamps was '0' That is not correct. I changed the value to '1' and also adjusted the opcache.revalidate_freq to '60' seconds. https://www.php.net/manual/en/opcache.configuration.php#ini.opcache.validate-timestamps The strange thing is, that the opcache.validate_timestamps should be '1' by default.