Skip to content

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

Closed

Description

@sodnpoo

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.

Activity

  1. LukasReschke commented on Mar 16, 2013

    @LukasReschke
    Contributor
  2. sodnpoo commented on Mar 16, 2013

    @sodnpoo
    Author

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

  3. LukasReschke commented on Mar 16, 2013

    @LukasReschke
    Contributor

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

  4. DeepDiver1975 commented on Mar 16, 2013

    @DeepDiver1975
    Contributor

    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

  5. sodnpoo commented on Mar 16, 2013

    @sodnpoo
    Author

    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.

  6. MTGap commented on Mar 16, 2013

    @MTGap
    Contributor

    @sodnpoo Could you please open a pull request?

  7. sodnpoo commented on Mar 17, 2013

    @sodnpoo
    Author

    @MTGap done :)

  8. sodnpoo commented on Mar 19, 2013

    @sodnpoo
    Author

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

  9. butonic commented on Jun 24, 2013

    @butonic
    Contributor

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

  10. locked as resolved and limited conversation to collaborators on Aug 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions