Open ijurisic opened 6 years ago
This is a workaround that I've been using to use Nextcloud/Passman with PostgreSQL from this comment:
Suggested solution:
PostgreSqlSchemaManager.php
line 292:
$data = $this->_conn->fetchAll('SELECT min_value, increment_by FROM ' . $this->_platform->quoteIdentifier($sequenceName));
to:
$version = floatval($this->_conn->getWrappedConnection()->getServerVersion());
if ($version >= 10) {
$data = $this->_conn->fetchAll('SELECT min_value, increment_by FROM pg_sequences WHERE schemaname = \'public\' AND sequencename = '.$this->_conn->quote($sequenceName));
}
else
{
$data = $this->_conn->fetchAll('SELECT min_value, increment_by FROM ' . $this->_platform->quoteIdentifier($sequenceName));
}
In my case workaround not help.
{"reqId":"VBhvev1rdXhWyOj1MnLU","level":3,"time":"2018-01-26T10:50:28+00:00","remoteAddr":"192.168.4.237","user":"ivan","app":"core","method":"POST","url":"\/index.php\/settings\/ajax\/enableapp.php","message":"An exception occurred while executing 'ALTER TABLE oc_passman_share_request ALTER item_id TYPE BIGINT':\n\nSQLSTATE[42804]: Datatype mismatch: 7 ERROR: column \"item_id\" cannot be cast automatically to type bigint\nHINT: You might need to specify \"USING item_id::bigint\".","userAgent":"Mozilla\/5.0 (X11; Linux x86_64; rv:56.0) Gecko\/20100101 Firefox\/56.0.3 Waterfox\/56.0.3","version":"12.0.5.3"}
How did you generate that error?
Error got when hit button "Enable" in Apps->Your Apps on Passman
Screenshot https://s7.postimg.cc/wtakfpbpn/passman.png
That's interesting because I have been using Passman with a Nextcloud 13 using a postgres 10 for a while without any issues now... what versions of PostgreSQL are you using ?
PostgreSQL 9.4.15 from official Debian Jessie repository.
I just got the same error, or almost the same.
I could enable/install it (maybe it throw this log, but didn't see it)
I could create a vault, but when I try to save a password, I see this error:
DriverException","Message":"An exception occurred while executing 'SELECT * FROM \"passman_credentials\" WHERE \"id\" = ?' with params [\"null\"]:\n\nSQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for type bigint: \"null\""
I guess it is related. (if it is not, then let's me know, I'll open a new issue).
Cloud log
``` {"reqId":"es9mToE2Ydvuy0BgdnPI","level":3,"time":"2018-01-19T09:15:31+00:00","remoteAddr":"192.168.4.226","user":"ivan","app":"core","method":"POST","url":"\/index.php\/settings\/ajax\/enableapp.php","message":"An exception occurred while executing 'ALTER TABLE oc_passman_share_request ALTER item_id TYPE BIGINT':\n\nSQLSTATE[42804]: Datatype mismatch: 7 ERROR: column \"item_id\" cannot be cast automatically to type bigint\nHINT: You might need to specify \"USING item_id::bigint\".","userAgent":"Mozilla\/5.0 (X11; Linux x86_64; rv:56.0) Gecko\/20100101 Firefox\/56.0.3 Waterfox\/56.0.3","version":"12.0.4.3"} ```