Been messing with the discussion plugin trying to post images/files in the main post and replies. Keeps throwing this error after I upload it and give it a title (made sure I had my folder permissions set up).

Notice: Undefined property: stdClass::$uri in file_save() (line 566 of /var/www/vhosts/ghostinteractive.com/subdomains/atrium2/includes/file.inc).
Notice: Undefined property: stdClass::$uri in file_entity_file_presave() (line 14 of /var/www/vhosts/ghostinteractive.com/subdomains/atrium2/profiles/openatrium/modules/contrib/file_entity/file_entity.file.inc).
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '' for key 'uri': INSERT INTO {file_managed} (filemime, filesize, status, timestamp, type) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4); Array ( [:db_insert_placeholder_0] => application/octet-stream [:db_insert_placeholder_1] => 0 [:db_insert_placeholder_2] => 1 [:db_insert_placeholder_3] => 1367956409 [:db_insert_placeholder_4] => image ) in drupal_write_record() (line 7165 of /var/www/vhosts/ghostinteractive.com/subdomains/atrium2/includes/common.inc).

Note: I have not updated any of the modules besides updating the OA core from alpha2 ~ alpha3.

CommentFileSizeAuthor
#3 Screen Shot 2013-05-22 at 4.35.11 PM.png338.96 KBduckydan

Comments

mpotter’s picture

Can you give me step-by-step procedure for reproducing this? I don't know if you are using the embed button in the WYSIWYG or if you are using the Attachments field at the bottom.

mpotter’s picture

Status: Active » Postponed (maintainer needs more info)
duckydan’s picture

Component: Discussion plugin » Code
Status: Postponed (maintainer needs more info) » Active
StatusFileSize
new338.96 KB

Hi, I am having this same error. I am on Alpha 5. I have tried three server. I have tried the drush make files, the build.sh script, just downloading the distro and installing. I have verified permissions over and over.

I so very much wanted to get this running so my library would use it for all our web projects, but I can't even install OA 2.

Every single time I install, I get to:

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '' for key 'uri'

Right after giving the site a name and such.

I am at my wit's end.

Any guidance would be so appreciated.

I hope it's ok to make this active again.

duckydan’s picture

Just to clarify, my issues is installing, not posting images, but the error is very similar. "Duplicate entry '' for key 'uri'"

mcrittenden’s picture

Title: Posting File in Comment: Error » Error: Duplicate entry '' for key 'uri'
Version: 7.x-2.0-alpha3 » 7.x-2.0-alpha5

I have the same exact error as #3 on install.

@duckydan, what version of PHP are you running? I'm on 5.4.15 which might be related.

joshua.boltz’s picture

I've tried installing OpenAtrium Alpha 5 on PHP 3, 4, 5 on my local Mac using XAMPP, Acquia Dev Desktop, and MAMP.

I also get the same error as #3.
FYI - When installed on Acquia Dev Desktop, I also got an error about a missing IMAP extension, so I copied the imap.so from the XAMPP modules folder over to the extensions folder on Dev Desktop and edited the php.ini file to check for the imap.so, and then it installed, up until the below error ended my excitement.

Needless to say, I'm anxious for the next release, hoping it's more stable and can be installed on a local server. I have not yet tried a live domain, but I'm assuming that would work.

Let me know what you've done to make it work for your use.

mcrittenden’s picture

Priority: Normal » Critical

Some more information, I get the same error on alpha 4 (I get other errors on alpha 3 and didn't go back any further than that).

I tested on a different box that's PHP 5.2 instead of my normal 5.4 and I get a slightly different error:

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '' for key '2'

I would call this critical since it's preventing installation.

P.S. Hey joshuaboltz! Small world!

mcrittenden’s picture

After some investigating, looks like it wants there to be a sites/default/filesprivate directory and it fails if that doesn't exist. So here's a workaround:

1. Create sites/default/filesprivate and make it writeable (might as well chmod 777 temporarily just to be sure)
2. If you've already gotten the error above then that means the system inserted a single bad record into file_managed so you'll need to open up MySQL and run "delete from file_managed"
3. Refresh the installer. It should work this time.

mcrittenden’s picture

Title: Error: Duplicate entry '' for key 'uri' » Error: Duplicate entry '' for key 'uri' due to system looking for sites/default/filesprivate
joshua.boltz’s picture

@mcrittenden, small world indeed! Thanks for all your help in the past. Hope all is well.
I'm looking forward to seeing what OpenAtrium can do (once it can be installed)!

mpotter’s picture

Status: Active » Fixed

Fixed in 6fc6e1b. There was a missing / in oa_config.install when adding 'private' to the file path.

The IMAP issue is already in #1999962: Mailhandler PHP IMAP requires that PHP's IMAP extension is enabled in order to function properly.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

Added update history.