Open BelgarathS opened 2 years ago
Thank you @BelgarathS for reporting.
But regarding the message you get, it indicates that you haven't selected any folder in which to store your new item. A few commits before, this could occurred in specific condition but it should have been fixed.
The error you get in log are not related to the step you
Hi, thank you for responding, when I load the page i got the following:
the /pass/sources/items.queries.php fails with error 500
and I get the following in error_log:
[Sat Sep 10 19:26:05.408053 2022] [php:error] [pid 95789] [client 192.168.231.201:33288] PHP Fatal error: Uncaught mysqli_sql_exception: Unknown column 'visible_folders' in 'field list' in /var/www/html/pass/includes/libraries/Database/Meekrodb/db.class.php:682\nStack trace:\n#0 /var/www/html/pass/includes/libraries/Database/Meekrodb/db.class.php(682): mysqli->query()\n#1 /var/www/html/pass/includes/libraries/Database/Meekrodb/db.class.php(637): MeekroDB->queryHelper()\n#2 /var/www/html/pass/includes/libraries/Database/Meekrodb/db.class.php(638): MeekroDB->prependCall()\n#3 /var/www/html/pass/includes/libraries/Database/Meekrodb/db.class.php(753): MeekroDB->query()\n#4 /var/www/html/pass/includes/libraries/Database/Meekrodb/db.class.php(66): MeekroDB->queryFirstRow()\n#5 /var/www/html/pass/sources/main.functions.php(3595): DB::queryFirstRow()\n#6 /var/www/html/pass/sources/items.queries.php(6052): loadFoldersListByCache()\n#7 {main}\n thrown in /var/www/html/pass/includes/libraries/Database/Meekrodb/db.class.php on line 682, referer: https://banda.pl/pass/index.php?page=items
And you're right I don't select any folder but my folder field is empty:
I assumed this is because of the error quoted above i.e not having a field called "visible_folders".
Please let me know if I can do anything more to help here
Please use latest commit and run the upgrade process
I'm running 3.0.0.17-77-gea87ad2a (which seems to be the latest at this stage)
When trying to run upgrade: /install/upgrade.php
I get the following error: [Sun Sep 11 13:43:21.771687 2022] [php:error] [pid 98075] [client 192.168.231.201:33418] PHP Fatal error: Uncaught mysqli_sql_exception: Incorrect table definition; there can be only one auto column and it must be defined as a key in /var/www/html/pass/install/upgrade_run_3.0.0.php:873\nStack trace:\n#0 /var/www/html/pass/install/upgrade_run_3.0.0.php(873): mysqli_query()\n#1 {main}\n thrown in/var/www/html/pass/install/upgrade_run_3.0.0.php on line 873, referer: https://banda.pl/pass/install/upgrade.php
the page hangs at the following:
Can confirm having this issue on a last master commit (b55dbf9) with PHP 7.4.3, Chrome 105.0.5195.102. Page /index.php?page=items# after pressing button "New item" on a existing group After fresh install tried to add password for just created folder, but got popup error "At least one folder needs to be selected". Folder field at Details tab are empty, so it's not possible to choose any, even if I try to create password in a folder with children folders.
I edited page HTML and created selected option tag in #form-item-folder select with folder ID that I need, so form verification was able to be passed, password was created and this issue are not reproducing anymore, because now Folder field shows all available folders
The issue may be with the cache_tree table.
Scenario: 1., A new folder is created 2., User's role is allowed write access to the folder
Expected result: User should see the folder in details view when creating new item.
Actual result: Use does not see the folder in the details view, so cannot create items in that folder. Logoff and logon of the user does not refresh this.
Workaround: Run in MySQL (keep in mind the teampass_ prefix may be different for you depending in what you specified during install): delete from teampass_cache_tree; Or run "Reload cache table" action .
Fix: Automatically "Reload cache table" when a role is assigned access to a folder for all affected users. Or not use cache at all :) .
after running the command above the tree is not loaded with the following error message: [Sat Sep 17 22:59:27.838901 2022] [php:error] [pid 168601] [client 192.168.231.201:34662] PHP Fatal error: Uncaught mysqli_sql_exception: Unknown column 'visible_folders' in 'field list' in /var/www/html/pass/includes/libraries/Database/Meekrodb/db.class.php:682\nStack trace:\n#0 /var/www/html/pass/includes/libraries/Database/Meekrodb/db.class.php(682): mysqli->query()\n#1 /var/www/html/pass/includes/libraries/Database/Meekrodb/db.class.php(637): MeekroDB->queryHelper()\n#2 /var/www/html/pass/includes/libraries/Database/Meekrodb/db.class.php(638): MeekroDB->prependCall()\n#3 /var/www/html/pass/includes/libraries/Database/Meekrodb/db.class.php(361): MeekroDB->query()\n#4 /var/www/html/pass/includes/libraries/Database/Meekrodb/db.class.php(365): MeekroDB->insertOrReplace()\n#5 /var/www/html/pass/includes/libraries/Database/Meekrodb/db.class.php(79): MeekroDB->insert()\n#6 /var/www/html/pass/sources/main.functions.php(3513): DB::insert()\n#7 /var/www/html/pass/sources/tree.php(223): cacheTreeUserHandler()\n#8 {main}\n thrown in /var/www/html/pass/includes/libraries/Database/Meekrodb/db.class.php on line 682
running :
ALTER TABLE teampass_cache_tree
ADD COLUMN visible_folders INT(1);
fixes the issue, but that probably breaks the installation for further upgrades.
Page on which it happened
pass/index.php?page=items# I can't edit any passwords
Steps to reproduce
Expected behaviour
Database layout should add missing fields or there should be a way to update them
Actual behaviour
System throws PHP errors about missing columns The popup message"At least one folder needs to be selected shows"
Server configuration
Operating system: Linux pass 5.15.0-46-generic #49-Ubuntu SMP Thu Aug 4 18:03:25 UTC 2022 x86_64
Web server: Apache/2.4.52 (Ubuntu)
Database: 5.5.5-10.6.7-MariaDB-2ubuntu1.1
PHP version: 8.1.2
Teampass version: 3.0.0.18
Teampass configuration file:
Updated from an older Teampass or fresh install:
Client configuration
Browser: - Chrome - Version 105.0.5195.102 (Official Build) (64-bit) Operating system: - bits ubuntu 22.04
Logs
Web server error log
Teampass 10 last system errors
Log from the web-browser developer console (CTRL + SHIFT + i)
csrfprotector.js:1 Failed to load resource: the server responded with a status of 404 (Not Found) /pass/sources/items.queries.php:1 Failed to load resource: the server responded with a status of 500 (Internal Server Error) /pass/sources/items.queries.php:1 Failed to load resource: the server responded with a status of 500 (Internal Server Error)