Hi Susana,
First, whenever reporting an issue and seeking assistance in the user forum, it's helpful for us to know more about your specific installation - this helps us determine how we can try to reproduce the issue locally under the same conditions, as well as whether or not it's a bug in a specific release, an issue with your particular installation, or a user error. Things that are useful to share include:
- What is the full AtoM version number or your installation, as found in Admin > Settings?
- Did you follow exactly the recommended installation instructions for your version? If no, what changes have you made?
- Are you a custom theme, and/or does your installation have any other local code customizations?
- If not, are you using the older default Bootstrap 2 Dominion theme, or the new Bootstrap 5 Dominion theme included in 2.7 and later?
- Does your AtoM installation meet the recommended minimum hardware requirements listed here? Most importantly, do you have 7GB or more of memory?
- Do you get this Elasticsearch error message when clicking on all links, or just some (like just description links, or just some from a specific collection, etc)?
- Are there any important previous actions that might have caused this worth mentioning? For example, did you upgrade recently? Did someone attempt an import? When and why, to the best of your knowledge, did this start happening?
- What, if anything, have you tried so far to investigate and/or resolve the issue? And what happened?
Please provide as much information in response as you can, as it will allow us to offer better suggestions for resolving your issue. In the meantime, here are some things you can try:
The following commands should all be run in the command-line interface, starting from AtoM's root installation directory - which, if you followed our recommended installation instructions, is typically located at /usr/share/nginx/atom.
First, let's use the command line task to get more information about your search index. Please share the output of this task:
We can also repopulate the search index, which often resolves issues with it. Keep in mind that this task will temporarily make records in your public-facing catalog disappear, until the search index is rebuilt, which will take anywhere from minutes to hours depending on the size of your collection. For this reason, we often recommend that public-facing production installations run this task outside of normal business hours. We will also clear the various caches used in the application, to ensure we are seeing the latest results.
First however, let's run a few other maintenance tasks that can often resolve many common issues, and won't do any harm if they are not related to the problem. These tasks all run much faster, so there is less need to run them after business hours.
To begin, let's make sure that all records have slugs - that is, the unique part of the URL related to a record, sometimes called a permalink. Occasionally if something times out mid-process, you can end up with records that have no slug, which can cause errors. We can generate any missing slugs with:
We'll also rebuild the nested set, which is an internal model used to organize hierarchical relations (like those found in an archival collection) in the relatively flat, table-like structure of a relational database. As with the slugs, sometimes when a long-running process is interrupted, the nested set can become corrupted - but fortunately in AtoM it is quick and easy to rebuild:
Finally, let's clear all caches that AtoM uses. These are stored versions of pages users visit, which can then be reloaded and served again much faster than having to fetch all the data from the database. However, sometimes what is in the cache does not accurately represent the current state of our source of truth, the database, so it's always a good idea to flush these before testing. First, there is the application cache:
Additionally, PHP-FPM has its own cache. This command depends on what version of PHP you have installed. If you are using AtoM 2.7 and followed our recommended installation instructions, this will be PHP 7.4. If not, check the documentation for your version.
Finally, be aware that your web browser has its own cache! It can be a good idea to clear this before testing, or else do your testing in a private / incognito browser window, where the cache is typically disabled by default.
Now we are ready to try re-populating the search index, which hopefully will resolve the issue. To repopulate the search index:
If you encounter an error when trying to run this task, there are a few more things we can still do.
First, Elasticsearch has its own logs we can look at, to see if there is more information about the error. You will typically find these at:
- /var/log/elasticsearch/elasticsearch.log
Please share any relevant error messages you find in them
We can try restarting the Elasticsearch service, and manually deleting the search index before running the repopulate command again. Here are the commands to control the ES service:
- sudo systemctl stop elasticsearch
- sudo systemctl enable elasticsearch
- sudo systemctl start elasticsearch
- sudo systemctl status elasticsearch
- sudo systemctl restart elasticsearch
You can use the status command to see if it's running, and then try stopping it. While stopped, we can manually delete the current index using cURL:
- curl -XDELETE 'localhost:9200/atom'
Note - if you get an error because cURL is not installed (i.e. a command not found or similar error), you may need to install it first. On Ubuntu, you can do this with:
- sudo apt update
- sudo apt install curl
Now we can restart the Elasticsearch service, and then see if the search population will work this time:
- sudo systemctl start elasticsearch
- php symfony search:populate
If nothing in this message has helped to resolve your issue, then hopefully we can provide further suggestions once you have given us more information about your AtoM installation and the error you're seeing.
Cheers,
@accesstomemoryhe / him