AtoM MySQL DB upgrade from 2.4 to 2.6 - PHP Fatal error

200 views
Skip to first unread message

Paul Haynes

unread,
Apr 30, 2021, 7:14:37 AM4/30/21
to AtoM Users
Hello 

i am perform a migration of AtoM from an existing server to a new Ubuntu server and while performing the MySQL Database tables update task i get a PHP error. Is anyone able to give some advice on what i can do here. i've had a search on some of the error text and come up with nothing so far.

The Atom DB export from Server A (mySQL (Percona 5.6)) is a full export, and following instructions imported into Server B (mySQL 8).


Here's a paste from the console.

root@servername:~# mysql -u root -p -e "DROP DATABASE IF EXISTS atom;"
root@servername:~# mysql -u root -p -e "CREATE DATABASE atom CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci;"

root@servername:~# mysql -u root -p atom < /srv/atom-replication/atomfulldb.sql

root@servername:/usr/share/nginx/atom# php -d memory_limit=-1 symfony tools:upgrade-sql
PHP Fatal error:  Uncaught TypeError: Argument 1 passed to Elastica\Exception\ResponseException::__construct() must be an instance of Elastica\Request, string given, called in /usr/share/nginx/atom/plugins/arElasticSearchPlugin/lib/arElasticSearchPlugin.class.php on line 128 and defined in /usr/share/nginx/atom/vendor/elastica/Elastica/Exception/ResponseException.php:30
Stack trace:
#0 /usr/share/nginx/atom/plugins/arElasticSearchPlugin/lib/arElasticSearchPlugin.class.php(128): Elastica\Exception\ResponseException->__construct('Unexpected resp...')
#1 /usr/share/nginx/atom/plugins/arElasticSearchPlugin/lib/arElasticSearchPlugin.class.php(147): arElasticSearchPlugin->getVersion()
#2 /usr/share/nginx/atom/plugins/arElasticSearchPlugin/lib/arElasticSearchPlugin.class.php(93): arElasticSearchPlugin->checkVersion()
#3 /usr/share/nginx/atom/lib/search/QubitSearch.class.php(39): arElasticSearchPlugin->__construct(Array)
#4 /usr/share/nginx/atom/lib/search/QubitSearch.class.php(49): QubitSearch::getInstance(Array)
#5 /usr/share/nginx/ in /usr/share/nginx/atom/vendor/elastica/Elastica/Exception/ResponseException.php on line 30

Fatal error: Uncaught TypeError: Argument 1 passed to Elastica\Exception\ResponseException::__construct() must be an instance of Elastica\Request, string given, called in /usr/share/nginx/atom/plugins/arElasticSearchPlugin/lib/arElasticSearchPlugin.class.php on line 128 and defined in /usr/share/nginx/atom/vendor/elastica/Elastica/Exception/ResponseException.php:30
Stack trace:
#0 /usr/share/nginx/atom/plugins/arElasticSearchPlugin/lib/arElasticSearchPlugin.class.php(128): Elastica\Exception\ResponseException->__construct('Unexpected resp...')
#1 /usr/share/nginx/atom/plugins/arElasticSearchPlugin/lib/arElasticSearchPlugin.class.php(147): arElasticSearchPlugin->getVersion()
#2 /usr/share/nginx/atom/plugins/arElasticSearchPlugin/lib/arElasticSearchPlugin.class.php(93): arElasticSearchPlugin->checkVersion()
#3 /usr/share/nginx/atom/lib/search/QubitSearch.class.php(39): arElasticSearchPlugin->__construct(Array)
#4 /usr/share/nginx/atom/lib/search/QubitSearch.class.php(49): QubitSearch::getInstance(Array)
#5 /usr/share/nginx/ in /usr/share/nginx/atom/vendor/elastica/Elastica/Exception/ResponseException.php on line 30

Thanks 

Paul 

Dan Gillean

unread,
May 4, 2021, 1:48:42 PM5/4/21
to ICA-AtoM Users
Hi Paul, 

The stack trace is pointing to this particular function in AtoM's code: 
However, all that function is trying to do is get the Elasticsearch version installed. I suspect that either you have the wrong version of ES installed, or ES is down, or some step was missed in the upgrading process related to Elasticsearch. 

In 2.4, we were still using Elasticsearch version 1.x, while in 2.5 and later we've upgraded to Elasticsearch 5.6. Did you remember to upgrade Elasticsearch as well? As an aside, note that AtoM 2.4 used PHP 5.x, while 2.6 requires PHP 7.2. 

It's also possible that ES is just down and needs a restart. Some commands and tasks that can hopefully gather more information for us:

First, check the status of the service via systemd: 
  • sudo systemctl status elasticsearch
If it's not running, you can try: 
  • sudo systemctl restart elasticsearch
You can also try using the search:status task to check on your search index, and make sure it is running as expected. You can run the following task from AtoM's root installation directory - if you've followed our installation instructions, this is typically /usr/share/nginx/atom. Run: 
Please feel free to share the output of this command. 

Additionally, we can check on cluster health with: 
Again, please share anything you find there. 

Finally, it's also useful to know how much memory you have on your server - Elasticsearch can require a lot of memory, particularly during installation. Our recommended hardware specifications, on the technical requirements documentation page, are: 
  • Processor: 2 vCPUs @ 2.3GHz
  • Memory: 7GB
  • Disk space (processing): 50GB at a minimum for AtoM’s core stack plus more storage would be required for supporting any substantial number of digital objects.

While it's possible to run AtoM with less memory, having this much can really help avoid installation and initial configuration issues.

My final possibility to explore, if none of the above has helped - is it possible that you either skipped running the web installer, or misconfigured the search index connection details? You can try adding /index.php/sfInstallPlugin/configureSearch to your base URL to return to the search configuration page of the web installer. If you've followed our recommended installation instructions, then the credentials entered here should be: 
  • Search host: localhost
  • Search port: 9200
  • Search index: atom
Hopefully some of this will help with your troubleshooting! If you're stuck, please share more information about your installation (e.g. ES version, PHP version, etc), and the outputs of some of the tasks listed above, and we'll see if we can offer further suggestions. 

Cheers, 

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


--
You received this message because you are subscribed to the Google Groups "AtoM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ica-atom-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ica-atom-users/b68fc758-5b8c-479e-b7c5-106e0936127fn%40googlegroups.com.

Paul Haynes

unread,
May 7, 2021, 11:19:51 AM5/7/21
to AtoM Users
Thanks Dan for the info,

The elasticsearch service is running ok. it was installed from the https://www.accesstomemory.org/en/docs/2.6/admin-manual/installation/linux/ubuntu-bionic/ instructions on a clean install and since i submitted the topic i have removed and reinstalled elasticsearch and java cleanly. But no difference in effect. We noticed another conversation you were in mentioning about java and so checked that too. The version of openjdk java was 8update 292, but your open example said v11. Docs says 8, but removing 8 and leaving default ubuntu openjdk11 stil produced the same result. checked this as its a dependency for elasticsearch. 

root@xxxvmliat83:/# systemctl status elasticsearch
● elasticsearch.service - Elasticsearch
   Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2021-05-07 11:49:23 BST; 17min ago
     Docs: http://www.elastic.co
  Process: 3210 ExecStartPre=/usr/share/elasticsearch/bin/elasticsearch-systemd-pre-exec (code=exited, status=0/SUCCESS)
 Main PID: 3211 (java)
    Tasks: 35 (limit: 4915)
   CGroup: /system.slice/elasticsearch.service
           └─3211 /usr/bin/java -Xms2g -Xmx2g -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnl

May 07 11:49:23 xxxvmliat83.norfolk.gov.uk systemd[1]: Starting Elasticsearch...
May 07 11:49:23 xxxvmliat83.norfolk.gov.uk systemd[1]: Started Elasticsearch.
May 07 11:49:23 xxxvmliat83.norfolk.gov.uk elasticsearch[3211]: OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in
lines 1-13/13 (END)

We kept our instances of AtoM to default folder locations as made things simple, and no need to make work harder on ourselves so all PHP commands are run from /usr/share/nginx/atom.

Running "php symfony search:status" results in the following

root@xxxvmliat83:/# cd /usr/share/nginx/atom
root@xxxvmliat83:/usr/share/nginx/atom# php symfony search:status
Elasticsearch server information:
PHP Fatal error:  Uncaught TypeError: Argument 1 passed to Elastica\Exception\ResponseException::__construct() must be an instance of Elastica\Request, string given, called in /usr/share/nginx/atom/plugins/arElasticSearchPlugin/lib/arElasticSearchPlugin.class.php on line 128 and defined in /usr/share/nginx/atom/vendor/elastica/Elastica/Exception/ResponseException.php:30
Stack trace:
#0 /usr/share/nginx/atom/plugins/arElasticSearchPlugin/lib/arElasticSearchPlugin.class.php(128): Elastica\Exception\ResponseException->__construct('Unexpected resp...')
#1 /usr/share/nginx/atom/plugins/arElasticSearchPlugin/lib/arElasticSearchPlugin.class.php(147): arElasticSearchPlugin->getVersion()
#2 /usr/share/nginx/atom/plugins/arElasticSearchPlugin/lib/arElasticSearchPlugin.class.php(93): arElasticSearchPlugin->checkVersion()
#3 /usr/share/nginx/atom/lib/search/QubitSearch.class.php(39): arElasticSearchPlugin->__construct(Array)
#4 /usr/share/nginx/atom/lib/task/search/arSearchStatusTask.class.php(52): QubitSearch::getInstance()
#5 /usr/share in /usr/share/nginx/atom/vendor/elastica/Elastica/Exception/ResponseException.php on line 30
root@xxxvmliat83:/usr/share/nginx/atom#

While running a clear cache command from 
root@xxxvmliat83:/usr/share/nginx/atom/ php symfony cache:clear works correctly. so some PHP scripts do at least run. 

curl commands fail to give update/result
Firewall is disabled

specs are good 2 CPU and 8GB and a 100GB vmdk

Checking the connection in the configure url http://nccvmliat83.norfolk.gov.uk/index.php/sfInstallPlugin/configureSearch i get a " Sorry, you do not have permission to access that page" error now which was not the case during the initial install, it seemed to accept the localhost:9200 for atom ok during the initial install and once in atom content was ok and i could perform a search within. 

The main problem i had installing atom was i tried it from GIT and found missing content up in GIT, so reverted to tar download which worked fine. 

Here's some extra info;
root@xxxvmliat83:/etc/elasticsearch# curl -XGET 'http://localhost:9200'
root@xxxvmliat83:/etc/elasticsearch#
elastic search returns no content to curl or from browser so i am thinking that the site for this is not running at all. this could explain a lot here. I'll have another go over the instructions in case there is something i have overlooked. I have run the same test against my other 3 instances of Atom 2.4 and they come back fine. The goal here is in the end to migrate to Ubuntu 18 and upgrade to Atom 2.6.

root@xxxvmliat83:~# php -v
PHP 7.2.24-0ubuntu0.18.04.7 (cli) (built: Oct  7 2020 15:24:25) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.24-0ubuntu0.18.04.7, Copyright (c) 1999-2018, by Zend Technologies

Regards

Paul 

Dan Gillean

unread,
May 7, 2021, 12:56:29 PM5/7/21
to ICA-AtoM Users
Hi Paul, 

Thanks for this information. I can see that Elasticsearch is installed and running, but it seems like the main issue is that AtoM doesn't know about it. This suggests to me that something's not right in the web installer configuration, and I think we need to focus our efforts there. 

Regarding this: 

Checking the connection in the configure url http://nccvmliat83.norfolk.gov.uk/index.php/sfInstallPlugin/configureSearch i get a " Sorry, you do not have permission to access that page" error now which was not the case during the initial install, it seemed to accept the localhost:9200 for atom ok during the initial install and once in atom content was ok and i could perform a search within. 

First, did you make sure that you were logged into AtoM as an administrator before trying this? Note, you can create a new administrator account in AtoM from the command-line if needed - see: 
Also, you can certainly try accessing it via localhost again. Bascially, I think that you need to go back to the initial steps of the process - make sure the new AtoM installation is working on its own before trying to load your 2.4 data and run the upgrade task. 

One thing you can do that can help trigger the web installer again, is to try manually deleting the config/confg.php file. When this file is deleted, when you first try to access your site, AtoM should automatically redirect you to the web installer for configuration. As I mentioned before, make sure your server has enough RAM available during this stage!

Once you've successfully gotten through the web installer configuration steps and can access the new site, start the upgrading instructions over, and hopefully it might work better this time! 

Let us know how it goes, 

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

Paul Haynes

unread,
Jun 11, 2021, 8:36:23 AM6/11/21
to AtoM Users
Hi Dan

Thanks for your previous help.

We have been looking further into the base installation on and off over the last few weeks and found watching a fresh installation period this week that some packages had not installed. Listed below. 

mysql-apt-config_0.8.15-1_all.deb
libgomp1_8.4.0-1ubuntu1_18.04_amd64.deb
unzip_6.0-21ubuntu1.1_amd64.deb
php-common_60ubuntu1_all.deb
libwebp6_0.6.1-2ubuntu0.18.04.1_amd64.deb
libavahi-common-data_0.7-3.1ubuntu1.2_amd64.deb

Every time during the prerequisite installs i had to manually download the DEB and DPKG install them. With these installed and the installation of atom installer completed as per the instructions and without error the original fault still remained. 

linuxuser@xxxvmliat84:/usr/share/nginx/atom$ php symfony search:status
Elasticsearch server information:
PHP Fatal error:  Uncaught TypeError: Argument 1 passed to Elastica\Exception\ResponseException::__construct() must be an instance of Elastica\Reque                         st, string given, called in /usr/share/nginx/atom/plugins/arElasticSearchPlugin/lib/arElasticSearchPlugin.class.php on line 128 and defined in /usr/                         share/nginx/atom/vendor/elastica/Elastica/Exception/ResponseException.php:30
Stack trace:
#0 /usr/share/nginx/atom/plugins/arElasticSearchPlugin/lib/arElasticSearchPlugin.class.php(128): Elastica\Exception\ResponseException->__construct('                         Unexpected resp...')
#1 /usr/share/nginx/atom/plugins/arElasticSearchPlugin/lib/arElasticSearchPlugin.class.php(147): arElasticSearchPlugin->getVersion()
#2 /usr/share/nginx/atom/plugins/arElasticSearchPlugin/lib/arElasticSearchPlugin.class.php(93): arElasticSearchPlugin->checkVersion()
#3 /usr/share/nginx/atom/lib/search/QubitSearch.class.php(39): arElasticSearchPlugin->__construct(Array)
#4 /usr/share/nginx/atom/lib/task/search/arSearchStatusTask.class.php(52): QubitSearch::getInstance()
#5 /usr/share in /usr/share/nginx/atom/vendor/elastica/Elastica/Exception/ResponseException.php on line 30


linuxuser@xxxvmliat84:/usr/share/nginx/atom$  curl -XGET 'http://localhost:9200'
linuxuser@xxxvmliat84:/usr/share/nginx/atom$ "Nothing Returned"

linuxuser@xxxvmliat84:/usr/share/nginx/atom$ php -v
PHP 7.2.24-0ubuntu0.18.04.7 (cli) (built: Oct  7 2020 15:24:25) ( NTS )

Elastic Search Service running.

i can also rerun the web installer from URL successfully so that permission issue is not present.

Another thing i did do is replicate the same install process on a clean Ubuntu 18.04 VM install on my own laptop and the installation worked and i could perform the "php symfony search:status" commond successfully returning version and index status. The failing install is on a virtual server in our organisation which is on ESXI and behind a proxy, whereas my personsal install is direct home internet connection in VirtualBox.

So at the moment quite perplexed as to whats going on. I'm planning to monitor the server with a network colleague to see if anything is revealed about the behaviour of the machine when i run the command. i doubt it but could be surprised.

Thanks

Paul

Paul Haynes

unread,
Jun 11, 2021, 9:35:10 AM6/11/21
to AtoM Users
Update, just had a session with a colleague and found that the server was trying to go via out via our proxy server for http://localhost:9200 when its 127.0.0.1 so shouldn't have been. 

The answer at that point became clear to ensure env proxy settings correct.

root@xxxvmliat84:/usr/share/nginx/atom# env | grep proxy
https_proxy=http:// proxy.domain.etc:8080


nano /etc/environment
Save
reboot
make sure applied as below and retest

root@xxxvmliat84:/usr/share/nginx/atom# env | grep proxy
https_proxy=http:// proxy.domain.etc:8080

Hope this helps others that have a setup behind a proxy

Dan Gillean

unread,
Jun 11, 2021, 9:36:54 AM6/11/21
to ICA-AtoM Users
Great! Thanks for updating the thread with the solution that worked for you, Paul!

Cheers, 

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

Lalie Lapleni

unread,
Jun 23, 2021, 3:37:51 AM6/23/21
to ica-ato...@googlegroups.com
Good day,
Do some of you manage decentralized record centers with ATOM? What are the results?
Thanks a lot.
Rosalie Ndejuru
Expert in Archives and Library systems
National Archives and Library Services
Rwanda



--
Rosalie Ndejuru

Dan Gillean

unread,
Jun 23, 2021, 9:05:51 AM6/23/21
to ICA-AtoM Users
Hi Rosalie, 

In case you didn't see it, I have offered some initial thoughts to your question on the other thread you posted, here: 
Hope it helps! 

Cheers, 

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

Lalie Lapleni

unread,
Jun 24, 2021, 5:13:03 AM6/24/21
to ica-ato...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages