-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
insert operations under some circumstances refused on postgreSQL (NC14) #12465
Comments
GitMate.io thinks possibly related issues are #3761 (PostgreSQL support), #9961 (PostgreSQL DeadLock), #4375 (User deletion fails in some circumstances), #8825 (PostgreSQL: Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'INSERT INTO "oc_schedulingobjects"), and #10612 (WebDAV in NC14). |
Autoincrement enabled for this table? I guess it's not possible to use this insert method on tables without autoincrement. Maybe it's not happening when u use qbmapper? |
Yes, autoincrement should be enabled: mysql> describe oc_dashboard_settings;
+-------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------+-------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| key | varchar(45) | NO | | NULL | |
| value | int(11) | NO | | 0 | |
+-------+-------------+------+-----+---------+----------------+
3 rows in set (0,00 sec)1 row in set (0,00 sec) QBMapper calls the same method: |
I got hit with this when trying out the new social app. I guess the ORM has a bug for pgsql. Please let me know if you want the generated ddl. |
Yes. |
nextcloud.ddl.txt |
The insert operation for which table fails for you @mikaelfrykholm? |
I tried creating a new post with the new ActivityPub implementation. |
Thank you @mikaelfrykholm You are running into owncloud/core#10080. There is no autoincrement flag set for
@rullzer @ChristophWurst if the id is already set we should not ask the database for an id again? not sure if this is a save change. maybe some bad code relies on this behaviour. let me know what you think.
|
Sounds good to me. @nickvergessen is our expert for all types of database questions 😉 |
Yes, lastval only works when autoincrement was generated as far as i know. So checking it only when id was null. |
15.0.1 is scheduled for 2019-10-01 and will ship a fix. |
Well, in the case of Dashboard branche stable14, the inserted primary key is not null. I won't reopen this issue, because i think the App creator chose the wrong table scheme. Thank you all and a happy new year. |
First of all, i'm inexperienced with the oddities of postgreSQL.
A user of the Dashboard App reported a problem related to postgreSQL.
nextcloud/dashboard#44
The root of the problem lies in the postgre specific lastInsertId() method.
These tries to execute:
SELECT lastval()
in class:
https://github.com/nextcloud/server/blob/master/lib/private/DB/AdapterPgSql.php#L29
for each insert operation, initiated in class:
https://github.com/nextcloud/server/blob/master/lib/public/AppFramework/Db/Mapper.php#L132
But it seems, that's under some circumstances not allowed and results in a exception.
Each App relies on AppFramework and if a App needs their own database table(s), then it uses the provided database methods.
The text was updated successfully, but these errors were encountered: