AtoM 2.3, Site configuration, Unable to execute INSERT statement.

386 views
Skip to first unread message

John Hewson

unread,
Jul 28, 2016, 6:49:17 AM7/28/16
to ICA-AtoM Users
Hi,

I have a working installation of AtoM 2.2.1 on a local server, in dir, db, user, and index all called atom. I'm trying to test an installation of AtoM 2.3 in dir, db, user, and index all called atomic.

Installed dependencies:
Ubuntu 14.04.1 LTS
Apache/2.4.7
elasticsearch "number" : "1.7.5"
java version "1.7.0_101"
mysql  Ver 14.14 Distrib 5.5.38
PHP Version 5.5.9-1ubuntu4.17
memcached Version 2.1.0
gearmand 1.0.6

The web installer runs till I submit the site-configuration form, when I get:

"Sorry, something went wrong.
The server returned a 500 Internal Server Error.

Try again a little later or ask in the discussion group."

Which is why I'm here. My logs show:

"Unable to execute INSERT statement. [wrapped: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`atomic`.`acl_user_group`, CONSTRAINT `acl_user_group_FK_2` FOREIGN KEY (`group_id`) REFERENCES `acl_group` (`id`) ON DELETE CASCADE)], referer: http://www.phoenix.me/atomic/index.php/sfInstallPlugin/configureSite"

Any ideas where I've gone wrong?

John

Dan Gillean

unread,
Jul 28, 2016, 11:15:47 AM7/28/16
to ICA-AtoM Users
Hi John,

Have you tried loading your 2.2 data into this 2.3 test site, or is the database still empty? I'm wondering if running the purge task and the sql upgrade task might resolve the issue, but doing so will destroy any data you currently have loaded in the site. Here are some suggestions if you're willing to do that. All commands should be run from the root AtoM directory.

1) Try running the purge task - this will remove all data. If you want to also create a default administrator account (de...@example.com, p: demo) you can add the --demo flag to the end.
  • php symfony tools:purge
  • Purge docs

2) You can run the upgrade task again at this point, just to make sure that the schema migrations are correct.

  • php symfony tools:upgrade-sql

3) Clear the cache and restart your services:

  • php symfony cc
  • sudo service php5-fpm restart
  • sudo /etc/init.d/memcached restart
  • For good measure, might as well restart Apache (we don't currently maintain documentation on installation with Apache).
  • Re-index: php symfony search:populate

Try the web installer again?

If that doesn't work, one alternative would be to try dropping and recreating the database - replace the <examples> with your specific db and user name:

  • mysql -u <username> -p -e 'drop database <new_database>; create database <new_database> character set utf8 collate utf8_unicode_ci;'

I'd suggest clearing the cache, restarting services, re-indexing again after that too.

Let me know if that helps!


Dan Gillean, MAS, MLIS
AtoM Program Manager
Artefactual Systems, Inc.
604-527-2056
@accesstomemory

--
You received this message because you are subscribed to the Google Groups "ICA-AtoM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ica-atom-user...@googlegroups.com.
To post to this group, send email to ica-ato...@googlegroups.com.
Visit this group at https://groups.google.com/group/ica-atom-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/ica-atom-users/8f3ca066-66dc-4830-bc63-219f4c18d5a2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

John Hewson

unread,
Jul 28, 2016, 4:37:28 PM7/28/16
to ICA-AtoM Users
Hi Dan,

Thanks for the help. No, I haven't yet reached the stage of trying to migrate 2.2 data. The database is still empty; there's nothing to purge. I've been round the block a couple of times, deleting the files, db, and index, to start from scratch, and bump into the same error at site configuration. In fact the installer had already thrown an error at the previous stage:

PHP Fatal error:  Allowed memory size of 268435456 bytes exhausted (tried to allocate 20 bytes) in /var/www/html/atomic/vendor/symfony/lib/i18n/sfCultureInfo.class.php on line 335, referer: http://www.phoenix.me/atomic/index.php/sfInstallPlugin/configureSearch

(something's eating a lot of memory) but I still got through to the site-configuration form.

Anything else I can try before deciding it's no go on this server config?

John

dh...@artefactual.com

unread,
Jul 28, 2016, 6:11:00 PM7/28/16
to ICA-AtoM Users

Hi John,

Does your 2.2.1 site still work? If I may ask, what's the URL? (I try http://www.phoenix.me/atom/ and just get your default blog page again, for instance).

Also, could you return the results of...

ls -alF /etc/apache2/sites-enabled/

I believe it would be.


Thanks,

     Dave Hume, Artefactual Systems Administrator

John Hewson

unread,
Jul 29, 2016, 4:28:35 AM7/29/16
to ICA-AtoM Users, dh...@artefactual.com
Hi Dave,

Yes, 2.2.1 still works nicely. Sorry, I should have obfuscated the top end of the referer; like the server, that's only local. We don't own phoenix.me (phoenix was a university mainframe back in the 70s and 80s, after which I have cheekily named a series of recycled servers). Not wishing to sound like HAL ("I'm sorry, Dave. I'm afraid I can't do that."), but I can't securely make the server visible beyond the LAN.

The only site enabled is the default:
lrwxrwxrwx 1 root root   35 Aug  7  2014 000-default.conf -> ../sites-available/000-default.conf
So 2.2.1 sits in /var/www/html/atom and 2.3 in /var/www/html/atomic. The config isn't the recommended one for AtoM (PHP as Apache module), because it's a testbed for a number of projects. If I can't get 2.3 to work on here, I'll try to snaffle another box.

Thanks,

John

dh...@artefactual.com

unread,
Jul 29, 2016, 7:32:51 PM7/29/16
to ICA-AtoM Users, dh...@artefactual.com

Hi John,

Ah okay, that makes sense. One of (very) older home computers is nicknamed HAL. I figured - own it.  :-)

Off the top of my head, might be worth trying something where you backup key files and temporarily disable the existing AtoM site to see if you can install the new one as if it were the only site (but still use 'atomic' naming scheme if the hope is to run both together). I can give you the steps for that... or do you think it might actually be easier for you to snag another machine and dive right in there (since you wouldn't have to worry about the  other projects)? Let me know.


I do have one more question, in /etc/php5/fpm/pool.d/, is there just atom.conf, or also www.conf (some kind of default)?



Thanks,

    Dave

John Hewson

unread,
Aug 1, 2016, 7:32:22 AM8/1/16
to ICA-AtoM Users, dh...@artefactual.com

Hi again Dave,

in /etc/php5/fpm/pool.d/, is there just atom.conf, or also www.conf?

In this case, neither, because PHP is running as Apache module. However ...

It looks like the mysql error that kicked me out of the installation script was indeed a symptom of the previous allowed-memory error. Solution (blushes): allow more memory. The recommended memory_limit is 512M and 2.3 clearly needs it. 2.2.1 would in fact install and run comfortably on 128M (I'd bumped it to 256M for unrelated purposes). Any way, I can now demo 2.3, and the 2.2 data migrated perfectly.

This is a useful nudge to switch to FPM for our production site: as a relatively sleepy site, it's been running happily on Ubuntu's default LAMP stack, but I suspect if I stress test 2.3 I may find that's not sustainable. Time to test PM settings first.

Thanks again for your help,

John 

Ariel Felippi

unread,
Dec 6, 2016, 6:01:34 AM12/6/16
to AtoM Users

Hi,

I got it:

Follow the steps:

Visit website:

https://serverpilot.io/community/articles/how-to-disable-strict-mode-in-mysql-5-7.html

And the attached image, here I commented the MySql standard and put what is below.

Remember to first stop the MySql service make the changes and then start it again

strinc_tables.png
Reply all
Reply to author
Forward
0 new messages