Skip to content
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

External storage SMB/CIFS share doesn't show in files app when using postgresql #2371

Closed
sodnpoo opened this issue Mar 16, 2013 · 9 comments · Fixed by #3666
Closed

External storage SMB/CIFS share doesn't show in files app when using postgresql #2371

sodnpoo opened this issue Mar 16, 2013 · 9 comments · Fixed by #3666

Comments

@sodnpoo
Copy link

sodnpoo commented Mar 16, 2013

Expected behaviour

SMB/CIFS share should appear in files app

Actual behaviour

Files app shows 'Nothing in here. Upload something!'

Steps to reproduce

  1. Install owncloud v5 using postgres as the database
  2. Enable the file_external app
  3. Configure a SMB/CIFS share
  4. Go to files app - share isn't displayed

Server configuration

Operating system: FreeBSD 9

Web server: Apache 2

Database: Postgres

PHP version: 5.3.8

ownCloud version: 5

Client configuration

Browser: Chromium

Operating system: Mint

Logs

Web server error log

Nothing significant in the default logs, however code modified to show failing SQL:

[Sat Mar 16 09:25:39 2013] [error] [client 213.249.189.99] query: INSERT INTO *PREFIX*filecache(mimepart, mimetype, mtime, size, etag, path_hash, path, parent, name, encrypted, storage) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?), referer: http://xxxx/index.php/settings/admin
[Sat Mar 16 09:25:39 2013] [error] [client 213.249.189.99] params: array (\n 0 => '1',\n 1 => '2',\n 2 => 1356257702,\n 3 => -1,\n 4 => '51443a932ff1d',\n 5 => 'd41d8cd98f00b204e9800998ecf8427e',\n 6 => '',\n 7 => -1,\n 8 => '',\n 9 => 0,\n 10 => '2',\n), referer: http://xxxx/index.php/settings/admin

ownCloud log (data/owncloud.log)

{"app":"cache","message":"Insert to cache failed: MDB2 Error: null value violates not-null constraint","level":3,"time":1363423632}

Additional information

Exactly the same system configured to use sqlite instead works as expected.

@LukasReschke
Copy link
Member

@MTGap

@sodnpoo
Copy link
Author

sodnpoo commented Mar 16, 2013

Hi Lukas, thanks for responding - are you suggesting there might be a fix in MTGap's repo's/commits?

@LukasReschke
Copy link
Member

No - but MTGap is the responsible developer and with this comment he got notified of this issue :-)

@DeepDiver1975
Copy link
Member

I had the same issue with mssql where empty strings have been converted to null by mdb2.
There is an option on mdb2.
Please have a look at db.php where the mssql connection is initialized.

In general we need to be more accurate in checking db errors.

@MTGap

@sodnpoo
Copy link
Author

sodnpoo commented Mar 16, 2013

Excellent - thanks DeepDiver1975 :)

I've added "$options['portability'] = $options['portability'] - MDB2_PORTABILITY_EMPTY_TO_NULL;" @ line 273 in db.php in the pgsql case block; copied from the mssql block as suggested - and now it's working.

@MTGap
Copy link
Contributor

MTGap commented Mar 16, 2013

@sodnpoo Could you please open a pull request?

sodnpoo added a commit to sodnpoo/core that referenced this issue Mar 17, 2013
Remove MDB2_PORTABILITY_EMPTY_TO_NULL from MDB2 options; fixes issue owncloud#2371
@sodnpoo
Copy link
Author

sodnpoo commented Mar 17, 2013

@MTGap done :)

@sodnpoo
Copy link
Author

sodnpoo commented Mar 19, 2013

I'll try and get a unit test together this week (sorry been unavailable for a few days).

@butonic
Copy link
Member

butonic commented Jun 24, 2013

@sodnpoo this should be fixed in master and stable5. can you confirm?

@lock lock bot locked as resolved and limited conversation to collaborators Aug 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants