CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • CiviCRM upload directories
Pages: [1]

Author Topic: CiviCRM upload directories  (Read 3460 times)

Neil Adair

  • I post occasionally
  • **
  • Posts: 78
  • Karma: 4
  • CiviCRM version: 4.5.8
  • CMS version: Drupal 7
  • MySQL version: MariaDB 10
  • PHP version: 5.5 FPM
CiviCRM upload directories
August 26, 2007, 10:41:38 am
I just installed a new Drupal/CiviCRM 1.8 test site and I see the Administer CiviCRM > Global Settings > Upload Directories have changed from previous versions.

Now - 1.8
Temporary Files   ./templates_c/en_US/upload/
Images            ./templates_c/en_US/persist/contribute/
Custom Files      ./templates_c/en_US/custom/

Before - 1.7?
Temporary Files   /var/www/www.example.com/files/civicrm/upload/
Images            /var/www/www.example.com/files/civicrm/persist/contribute/
Custom Files      /var/www/www.example.com/files/civicrm/upload/custom/

I've been having lots of trouble with a CiviCRM 1.7 site (may have been 1.6 originally) (also problems with MyISAM tables instead of InnoDB)

When did these change? Which are correct for 1.8? Why did I see nothing about this in the upgrade docs? What would be affected? Importing?

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: CiviCRM upload directories
August 26, 2007, 12:25:12 pm

Neil:

I'm pretty sure this has not changed in 1.8, can u check:

http://demo.civicrm.org/drupal/civicrm/admin/setting/path?reset=1

Note that these are directories, so CiviCRM really does not care about the location or hierarchy of this directory structure as long as the code can read/write to these directories. They are also manually changeable in the setting screen above and so could potentially have been changed by someone in your org?

The one change which we did make and sent mail to civicrm-dev was to move the custom directory to a higher level, hence:

Custom Files      /var/www/www.example.com/files/civicrm/custom/

lobo


A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Neil Adair

  • I post occasionally
  • **
  • Posts: 78
  • Karma: 4
  • CiviCRM version: 4.5.8
  • CMS version: Drupal 7
  • MySQL version: MariaDB 10
  • PHP version: 5.5 FPM
Re: CiviCRM upload directories
August 26, 2007, 02:41:41 pm
The ./templates_c directories are what I found when I did a clean install of CiviCRM 1.8 with which I have successfully imported contacts and contibutions.

Last night I tried the same imports on our main website using the same cleanly installed CiviCRM database, unsuccessfully. Even a single simple contact wouldn't import. There were no error messages or log messages to alert me that anything was amiss and CiviCRM went through it's expected routine and reported x number of contacts successfully imported, except they weren't.

I found the import files still in files/civicrm/upload

Which made me wonder when I saw the different entries and it worked flawlessly on import. This is on a different server (one I built). RAM and disc are in short supply on the server where the main website is hosted.

Neil

scritch

  • Guest
Re: CiviCRM upload directories
August 26, 2007, 04:28:01 pm
I've been having the same problem today: brand new install of 1.810954, importing records from a csv file reports success but no contacts are actually added. Checking files/civicrm I see all the files I attempted to import from are in there.

Have tried both with my fairly detailed real data and from a 5-line test csv file containing only First Name, Last Name and email address. Same results: everything looks normal, success is reported, but no import actually happens - the DB has no contacts.

BTW I tried creating a new contact manually using New Individual, and got this non-recoverable error:

"Database Error Code: Cannot add or update a child row: a foreign key constraint fails, 1216"

My platform: Drupal 5.1, PHP 5.2.1, MySQL 4.1.9 (InnoDB enabled), Apache 2

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: CiviCRM upload directories
August 26, 2007, 04:43:54 pm
Neil:

Can you try this on a fresh clean install of civicrm v1.8 and see if import works.

I just tried importing a simple first/last/email file in 1.8 (php5) and it worked fine

Also, can u try to reproduce this on demo

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: CiviCRM upload directories
August 26, 2007, 04:47:23 pm

Scritch:

i'd first get new individual to work before trying import

Can u give more details about the database error and FK failure. Can you check your mysql query/error log

Also can u "truncate" your drupal session and try again. Might be invalid data in the session db entry

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Neil Adair

  • I post occasionally
  • **
  • Posts: 78
  • Karma: 4
  • CiviCRM version: 4.5.8
  • CMS version: Drupal 7
  • MySQL version: MariaDB 10
  • PHP version: 5.5 FPM
Re: CiviCRM upload directories
August 26, 2007, 09:13:46 pm
The first clean Drupal/CiviCRM install the defaults in Global Settings > Upload Directories were

Temporary Files   ./templates_c/en_US/upload/
Images            ./templates_c/en_US/persist/contribute/
Custom Files      ./templates_c/en_US/custom/

This worked fine.

The second clean install I saw this in the default Global Settings > Upload Directories

Temporary Files   ./upload/
Images            ./persist/contribute/
Custom Files      ./custom/

This didn't work at all so I put in the first set but that didn't work either, go figure, they worked the first time.

It worked when I replaced them with the familiar (from civicrm.settings.php files)

Temporary Files   /var/www/web.doc.root/files/civicrm/upload/
Images            /var/www/web.doc.root/files/civicrm/persist/contribute/
Custom Files      /var/www/web.doc.root/files/civicrm/upload/custom/

When I saw the first set of directories I thought they may have changed to accommodate the automated installer (which I haven't tried, I have installed the CfC standalone) or multi languages.

The variability is not reassuring!

I'm having problems importing contributions, I'm getting errors about duplicates which don't exist. The files (multiple copies) are all ending up in files/upload. It doesn't seem to clean up at all after a failed import. If I'm matching to contacts using cid should I disable match to contacts with email address? Any problem with a contribution import seems to render it impossible to import the file subsequently. I just nuke the whole mess (including Drupal) and start from scratch.

Contacts on the other hand import very fast and reliably.

Neil


scritch

  • Guest
Re: CiviCRM upload directories
August 26, 2007, 10:45:04 pm
I truncated the Drupal sessions table, and that fixed the problem with creating a new individual, thanks (I suggest adding taking this step as a troubleshooting note, or I can if you like).

I then tried again to import, starting with a fresh, empty DB. I started with just the first 10 records from my csv file. That failed when I uploaded from my Mac (i.e. it reported success, but no records were actually added). Thinking it might possibly be an incompatibility with Mac files (although I tried converting carriage returns to newlines), I tried the same 10-record file from a PC. That worked. But then, when I tried a 500-record version of my csv file (from the PC), it failed. I suspect the Mac/PC thing was random?

I tried enabling MySQL logging (by editing the "log=" line in my.cnf from log=/dev/null to log=/var/log/mysqld.log) but no log shows up - don't know a lot about MySQL, so I may be missing something here.
« Last Edit: August 26, 2007, 10:54:20 pm by scritch »

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: CiviCRM upload directories
August 27, 2007, 12:48:51 am

can u check and ensure that your civicrm.settings.php has the following line:

ini_set('auto_detect_line_endings', '1');

Can u try to load the same file on demo (or a subset or randomize the contents) and see if it works. I suspect it will and most likely it is the line endings issue on your system

For the mysql log, did u restart the mysql server after u added the log line

lobo

A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: CiviCRM upload directories
August 27, 2007, 12:57:03 am

Neil:

CiviCRM uses the civicrm.settings.php file to read directory values during initialization. Most likely that set of values was present in the civicrm.settings.php file. This was done for backward compatibility reasons etc. You might want to retry the install with a minimal civicrm.settings.php file

Note tht CfC releases are on an unsupported/trunkversion. As such we cannot track down any issues regarding those releases reliably.

If you can reproduce the issue on demo, we can fix it :)

lobo


A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

scritch

  • Guest
Re: CiviCRM upload directories
August 27, 2007, 11:00:33 am
I think I've found the problem, and have import pretty much working now...

It looks like there were some fields in my csv file that CiviCRM didn't like, even though it didn't report any errors. I went through the csv again carefully to make sure it was as clean as possible (BTW I assume commas within fields can cause demarcation problems - should this be highlighted in the docs?). Then I started again by trying to import just First Name, Last Name & Email from all records. That worked (don't know why my earlier, similar test failed), so I tried a larger subset, and that worked too. So I'm narrowing in on identifying the fields from our spreadsheet that cause problems for CiviCRM.

Looks like CiviCRM's error-checking isn't catching these conditions, and somehow is able to report success prematurely. Will try to see what it might be about our problem fields that it doesn't like.

Meanwhile I suggest that anyone doing an import check the source file with great care, and if they're having trouble try this narrowing procedure of starting with a stripped-down subset and, assuming that works,  gradually expanding the number of fields per record until the problem fields are found.

(BTW I checked php.ini & it was set to allow Mac line endings.)
« Last Edit: August 27, 2007, 11:03:11 am by scritch »

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: CiviCRM upload directories
August 27, 2007, 12:01:34 pm

Scritch:

Please modify the documentation on the wiki as needed. Helps improve the quality of the docs :)

commas within fields should not cause demarcation problems as long as they are enclosed with quotes.

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • CiviCRM upload directories

This forum was archived on 2017-11-26.