Can't Add Items after upgrade

Upgraded to 4.1.0 and can’t add items. Everything goes fine but when I get to the Item Set, I click on one and it disappears from the list. If I try to go ahead and, it errors. The logs say:

2024-05-10T13:09:22+00:00 ERR (3): Omeka\Api\Exception\BadRequestException: The API does not support the “v1” resource. in /var/www/vhosts/tplibrary.org/local-history/application/src/Api/Manager.php:200
Stack trace:
#0 /var/www/vhosts/tplibrary.org/local-history/application/src/Api/Manager.php(115): Omeka\Api\Manager->execute()
#1 /var/www/vhosts/tplibrary.org/local-history/application/src/Controller/ApiController.php(81): Omeka\Api\Manager->read()
#2 /var/www/vhosts/tplibrary.org/local-history/vendor/laminas/laminas-mvc/src/Controller/AbstractRestfulController.php(373): Omeka\Controller\ApiController->get()
#3 /var/www/vhosts/tplibrary.org/local-history/application/src/Controller/ApiController.php(169): Laminas\Mvc\Controller\AbstractRestfulController->onDispatch()
#4 /var/www/vhosts/tplibrary.org/local-history/vendor/laminas/laminas-eventmanager/src/EventManager.php(319): Omeka\Controller\ApiController->onDispatch()
#5 /var/www/vhosts/tplibrary.org/local-history/vendor/laminas/laminas-eventmanager/src/EventManager.php(179): Laminas\EventManager\EventManager->triggerListeners()
#6 /var/www/vhosts/tplibrary.org/local-history/vendor/laminas/laminas-mvc/src/Controller/AbstractController.php(97): Laminas\EventManager\EventManager->triggerEventUntil()
#7 /var/www/vhosts/tplibrary.org/local-history/vendor/laminas/laminas-mvc/src/Controller/AbstractRestfulController.php(307): Laminas\Mvc\Controller\AbstractController->dispatch()
#8 /var/www/vhosts/tplibrary.org/local-history/vendor/laminas/laminas-mvc/src/DispatchListener.php(132): Laminas\Mvc\Controller\AbstractRestfulController->dispatch()
#9 /var/www/vhosts/tplibrary.org/local-history/vendor/laminas/laminas-eventmanager/src/EventManager.php(319): Laminas\Mvc\DispatchListener->onDispatch()
#10 /var/www/vhosts/tplibrary.org/local-history/vendor/laminas/laminas-eventmanager/src/EventManager.php(179): Laminas\EventManager\EventManager->triggerListeners()
#11 /var/www/vhosts/tplibrary.org/local-history/vendor/laminas/laminas-mvc/src/Application.php(325): Laminas\EventManager\EventManager->triggerEventUntil()
#12 /var/www/vhosts/tplibrary.org/local-history/index.php(21): Laminas\Mvc\Application->run()

If I try adding one without adding an Item Set, it errors still and logs this:

2024-05-10T14:57:06+00:00 ERR (3): Omeka\Api\Exception\NotFoundException: Omeka\Entity\Site entity with criteria {“slug”:“pamphlet”} not found in /var/www/vhosts/tplibrary.org/local-history/application/src/Api/Adapter/AbstractEntityAdapter.php:722
Stack trace:
#0 /var/www/vhosts/tplibrary.org/local-history/application/src/Api/Adapter/AbstractEntityAdapter.php(440): Omeka\Api\Adapter\AbstractEntityAdapter->findEntity()
#1 /var/www/vhosts/tplibrary.org/local-history/application/src/Api/Manager.php(230): Omeka\Api\Adapter\AbstractEntityAdapter->read()
#2 /var/www/vhosts/tplibrary.org/local-history/application/src/Api/Manager.php(115): Omeka\Api\Manager->execute()
#3 /var/www/vhosts/tplibrary.org/local-history/application/src/Mvc/MvcListeners.php(396): Omeka\Api\Manager->read()
#4 /var/www/vhosts/tplibrary.org/local-history/application/src/Mvc/MvcListeners.php(313): Omeka\Mvc\MvcListeners->prepareSite()
#5 /var/www/vhosts/tplibrary.org/local-history/vendor/laminas/laminas-eventmanager/src/EventManager.php(319): Omeka\Mvc\MvcListeners->preparePublicSite()
#6 /var/www/vhosts/tplibrary.org/local-history/vendor/laminas/laminas-eventmanager/src/EventManager.php(179): Laminas\EventManager\EventManager->triggerListeners()
#7 /var/www/vhosts/tplibrary.org/local-history/vendor/laminas/laminas-mvc/src/Application.php(304): Laminas\EventManager\EventManager->triggerEventUntil()
#8 /var/www/vhosts/tplibrary.org/local-history/index.php(21): Laminas\Mvc\Application->run()
#9 {main}

Neither of these errors looks related to the problem you described. Are you sure you’ve gotten the right error messages?

The first is an attempt to go to a /v1 URL in the REST API, and the second is an attempt to visit a private or nonexistent site “pamphlet.”

I can confirm the problem where the item sets “disappear” when you try to add them (they’re actually being added but we’re not correctly showing the list of current sets there), but that shouldn’t cause an error when saving.

So whatever you have going on that’s causing an error is probably unrelated to that.