Hi Matt,
Glad to hear all is well for now - and that this is a server for experimentation, and not something to be used in production. I would strongly advise you to flush the database (you can use the
tools:purge command to remove all entries) before you ever decide to start adding data you wish to keep - while things work now, knowing that there are partial (i.e. corrupted) entries in the db means that you could encounter other unexpected issues down the line, that might be harder to resolve.
In terms of why an import can lead to 500 errors.... it really depends and it's hard to say without knowing more about both your environment and the records you were attempting to import. However, in most cases it's often because 1) some process times (i.e. reaches one of the execution limits established in your PHP pool, or similar) or 2) the import process exhausts all available resources (like memory most often, or CPU, disk space, etc) such as when the CSV is too large or the system is under-resourced (or both), or 3) there are actual errors in the CSV itself. In all of these cases, you can end up with partially created rows in the database - i.e. information objects that have data in some of those tables I mentioned in my last post, but not others. This data corruption then returns a 500 error when another piece of code makes a request that can't be performed (like loading the view page of a record that's only partially imported). Of course, sometimes it's bugs in the application, deployment issues, CSV encoding issues, or any other number of causes - but it happens. Release 2.7 and later now include a CSV validation option that tries to catch data-related issues in advance - see:
As for why you can still see records when things are deleted from the database? That's not unexpected at all if you know a bit about how search indexes work, especially if you made manual deletions rather than using AtoM-supported processes to perform those deletions. I am no developer myself, but here's a quick summary of what I have learned from my colleagues over the years working with AtoM:
Essentially, it would be extremely inefficient for AtoM to access the database to return search and browse results - reading nearly every information object in the database just to prepare some stub results on demand. This would also make operations like faceting and filtering much harder. Instead, the Elasticsearch index basically creates a large JSON blob of all the data needed for search and browse, and Elasticsearch has its own built-in methods for rapidly handling filtering, faceting, and other boolean operations. As such, the search index is almost like a second flat data store, optimized for fast reads. The MySQL database remains the source of truth for the application however - which is why we can so easily run a reindex, where the previous JSON blob is thrown away, and a new one generated from the database. When that's not needed however, basically every search or browse page you see in AtoM is populated from the search index (i.e. no need to access the DB at all for that), while the individual view and edit pages of specific descriptions use PHP to interact with the database, fetching and returning records. Another way of flipping this around - you can delete your whole search index and see 0 records in search/browse - but if you know the URL to a specific record, you can still access it, since this uses the ORM and MySQL database and not the search index.
In any case, I'm glad that this was a test server, and that everything's working as expected for now! Thanks for updating us.