# The website encountered an unexpected error. Try again later

**URL:** <https://farmos.discourse.group/t/the-website-encountered-an-unexpected-error-try-again-later/1933>\
**Category:** Hosting farmOS\
**Created:** [March 15, 2024, 4:21pm UTC](https://farmos.discourse.group/t/the-website-encountered-an-unexpected-error-try-again-later/1933 "2024-03-15T16:21:57Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![tlcarpenter69](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/tlcarpenter69/32/1026_2.png) [@tlcarpenter69](https://farmos.discourse.group/u/tlcarpenter69)\
**Post date:** [March 15, 2024, 4:21pm UTC](https://farmos.discourse.group/t/the-website-encountered-an-unexpected-error-try-again-later/1933/1 "2024-03-15T16:21:57Z")

</div>

I’ve had farmos running in the past and have quite a bit of data in it. Something happened over the course of a few updates and now it’s not working. Now that it’s spring and calves are coming, I need to get it working again.

I first noticed I was getting the Access denied problem. When I added the /user to the URL and logged in, I saw this message:

**The website encountered an unexpected error. Try again later.**

On the console, I saw this error:

```auto
[Fri Mar 15 14:16:58.131592 2024] [php:notice] [pid 21] [client 192.168.254.119:55149] Uncaught PHP Exception TypeError: "Drupal\\Core\\Render\\Renderer::doRenderPlaceholder(): Return value must be of type Drupal\\Component\\Render\\MarkupInterface|string, null returned" at /opt/drupal/web/core/lib/Drupal/Core/Render/Renderer.php line 184

```

This is with a docker install. My compose looks like this:

```auto
version: "3"
services:
  www:
    # Update this to the latest stable version before deploying.
    # image: farmos/farmos:latest
    image: farmos/farmos:3.x
    volumes:
      - ./sites:/opt/drupal/web/sites
      - ./modules:/opt/drupal/web/modules/farmos
    ports:
      - 480:80
    restart: always
networks: {}

```

Modules in the modules directory:

```auto
farm_asset_termination
farm_eggs
farm_ledger
farm_nrcs
farm_profile
farm_project_plan
farm_weather
smtp

```

Suspecting a plugin in that plugin directory, I tried to delete them one at a time using the drush command. Now I’m stuck with this error:

```auto
[Fri Mar 15 16:00:56.255328 2024] [php:notice] [pid 19] [client 192.168.254.119:62316] Uncaught PHP Exception Drupal\\Component\\Plugin\\Exception\\PluginNotFoundException: "The "d7_farm_log" plugin does not exist. Valid plugin IDs for Drupal\\migrate\\Plugin\\MigrateSourcePluginManager are: csv_file, embedded_data, empty, url, table, csv" at /opt/drupal/web/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php line 53, referer: http://192.168.254.208:480/user/login

```

I need help knowing where to look, or where to go. The database is sqlite3.

---

<div class="post-metadata">

**Author:** ![mstenta](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/mstenta/32/4_2.png) [@mstenta](https://farmos.discourse.group/u/mstenta)\
**Post date:** [March 15, 2024, 4:37pm UTC](https://farmos.discourse.group/t/the-website-encountered-an-unexpected-error-try-again-later/1933/2 "2024-03-15T16:37:27Z")

</div>

Hi @tlcarpenter69 - let’s see if we can figure it out…

First thing that jumps out to me is:

```auto
image: farmos/farmos:3.x

```

It’s dangerous to use the `3.x` image directly (unless you’re doing development), because you might not know when an update occurs, and it is _critical_ that you run database updates (eg: `update.php` or `drush updb`) and rebuild caches (eg: `drush cr`) when you update from one version of farmOS to the next.

We recommend using a specific version (eg: `farmos/farmos:3.1.2`) so that you can make your updates an intentional process.

If you haven’t already, please read the full “Updating farmOS” guide: [Updating farmOS | farmOS](https://farmOS.org/hosting/update/)

So maybe my first question is: have you been running `drush updb` + `drush cr` with every update?

( **Also remember to take a database backup snapshot before each update!!** )

---

<div class="post-metadata">

**Author:** ![tlcarpenter69](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/tlcarpenter69/32/1026_2.png) [@tlcarpenter69](https://farmos.discourse.group/u/tlcarpenter69)\
**Post date:** [March 15, 2024, 4:40pm UTC](https://farmos.discourse.group/t/the-website-encountered-an-unexpected-error-try-again-later/1933/3 "2024-03-15T16:40:05Z")

</div>

Thanks for the feedback. I did switch to using 3.1.2 as part of the troubleshooting, but it didn’t really change. Also, I’ve totally missed the Updating guide. Let me look over that.

Also, if this install is totally borked, I’ve done a fresh install on another server. I’m not opposed to exporting the database from the old install and importing it into a new install.

---

<div class="post-metadata">

**Author:** ![mstenta](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/mstenta/32/4_2.png) [@mstenta](https://farmos.discourse.group/u/mstenta)\
**Post date:** [March 15, 2024, 4:49pm UTC](https://farmos.discourse.group/t/the-website-encountered-an-unexpected-error-try-again-later/1933/4 "2024-03-15T16:49:22Z")

</div>

Ah yea… so it could very well be that the database needs to be updated.

> [@tlcarpenter69](#):
>
> Also, if this install is totally borked, I’ve done a fresh install on another server. I’m not opposed to exporting the database from the old install and importing it into a new install.

You will need to run `drush updb` either way… because data or database schemas may need to be changed between versions, and that’s what `drush updb` does. So even if you export and reimport you will want to do that.

I would probably recommend taking a backup of your SQLite3 file right now, and then try running `drush updb` + `drush cr`. Maybe it will work smoothly!

Question: did you start on farmOS v3? Or do you think you may have missed the updates between v2 → v3 as well? Those are bigger.

---

<div class="post-metadata">

**Author:** ![mstenta](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/mstenta/32/4_2.png) [@mstenta](https://farmos.discourse.group/u/mstenta)\
**Post date:** [March 15, 2024, 4:50pm UTC](https://farmos.discourse.group/t/the-website-encountered-an-unexpected-error-try-again-later/1933/5 "2024-03-15T16:50:41Z")

</div>

> [@tlcarpenter69](#):
>
> Now that it’s spring and calves are coming, I need to get it working again.

PS: Once you do get it working again, check out the Birth Quick Form module… 😉

Here is a blog post about it: [Birth Quick Form | farmOS](https://farmos.org/blog/2023/birth-quick-form/)

---

<div class="post-metadata">

**Author:** ![tlcarpenter69](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/tlcarpenter69/32/1026_2.png) [@tlcarpenter69](https://farmos.discourse.group/u/tlcarpenter69)\
**Post date:** [March 15, 2024, 4:53pm UTC](https://farmos.discourse.group/t/the-website-encountered-an-unexpected-error-try-again-later/1933/6 "2024-03-15T16:53:11Z")

</div>

> [@mstenta](#):
>
> `drush updb` + `drush cr`

I ran the update.php and I ran the drush commands, at the end I got this:

```auto
 [success] No pending updates.
 [notice] Reverted config: core.entity_view_display.asset.animal.map_popup
 [notice] Reverted config: core.entity_view_display.asset.equipment.map_popup
 [notice] Reverted config: core.entity_view_display.asset.land.map_popup
 [notice] Reverted config: core.entity_view_display.asset.plant.map_popup
 [notice] Reverted config: core.entity_view_display.asset.structure.map_popup
 [notice] Reverted config: core.entity_view_mode.asset.map_popup
 [notice] Reverted config: core.entity_view_mode.quantity.plain_text
 [notice] Reverted config: log.type.input
 [notice] Reverted config: log.type.lab_test
 [notice] Reverted config: migrate_plus.migration_group.farm_import_csv
 [notice] Reverted config: plan.type.project
 [notice] Reverted config: system.action.asset_assign_action
 [notice] Reverted config: system.action.asset_parent_action
 [notice] Reverted config: system.action.project_add_log_action
 [notice] Reverted config: user.role.farm_account_admin
 [notice] Reverted config: views.view.farm_asset
 [notice] Reverted config: views.view.farm_asset_geojson
 [notice] Reverted config: views.view.farm_group_members
 [notice] Reverted config: views.view.farm_import_csv_asset
 [notice] Reverted config: views.view.farm_import_csv_log
 [notice] Reverted config: views.view.farm_import_csv_taxonomy_term
 [notice] Reverted config: views.view.farm_inventory
 [notice] Reverted config: views.view.farm_log
 [notice] Reverted config: views.view.farm_people
 [notice] Reverted config: views.view.farm_plan
 [notice] Reverted config: views.view.farm_quantity
 [notice] Reverted config: views.view.log_admin
 [notice] Reverted config: views.view.project_logs
 [notice] Reverted config: views.view.project_plans
 [error] Drupal\Component\Plugin\Exception\PluginNotFoundException: The "d7_farm_log" plugin does not exist. Valid plugin IDs for Drupal\migrate\Plugin\MigrateSourcePluginManager are: csv_file, embedded_data, empty, url, table, csv in Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition() (line 53 of /opt/drupal/web/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php). 
 [success] Cache rebuild complete.

```

Note the d7\_farm\_log erorr is still there.

---

<div class="post-metadata">

**Author:** ![mstenta](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/mstenta/32/4_2.png) [@mstenta](https://farmos.discourse.group/u/mstenta)\
**Post date:** [March 15, 2024, 4:53pm UTC](https://farmos.discourse.group/t/the-website-encountered-an-unexpected-error-try-again-later/1933/7 "2024-03-15T16:53:15Z")

</div>

> [@tlcarpenter69](#):
>
> Suspecting a plugin in that plugin directory, I tried to delete them one at a time using the drush command.

Just read this… do you mean you ran `drush pm-uninstall [module]` to _uninstall_ them? Or did you just delete them? Deleting them without installing would cause problems.

---

<div class="post-metadata">

**Author:** ![tlcarpenter69](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/tlcarpenter69/32/1026_2.png) [@tlcarpenter69](https://farmos.discourse.group/u/tlcarpenter69)\
**Post date:** [March 15, 2024, 4:55pm UTC](https://farmos.discourse.group/t/the-website-encountered-an-unexpected-error-try-again-later/1933/8 "2024-03-15T16:55:22Z")

</div>

Yes, I used drush to delete them. I think I used the shortcut though.  
drush pmu shortcut version.

---

<div class="post-metadata">

**Author:** ![mstenta](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/mstenta/32/4_2.png) [@mstenta](https://farmos.discourse.group/u/mstenta)\
**Post date:** [March 15, 2024, 4:55pm UTC](https://farmos.discourse.group/t/the-website-encountered-an-unexpected-error-try-again-later/1933/9 "2024-03-15T16:55:56Z")

</div>

> [@tlcarpenter69](#):
>
> Note the d7\_farm\_log erorr is still there.

Oh OK! So actually maybe you are pretty up-to-date after all! Otherwise I would have seen a lot more updates in that log… but the fact that it says `[success] No pending updates.` is good!

As for that error specifically… yea that’s one that I can help you fix…

It _may_ be related to `farm_ledger`… what version of that do you have? You need to be running version 2.1.2 of that module.

(And if you update it, you also need to run `drush updb` + `drush cr` again!)

---

<div class="post-metadata">

**Author:** ![tlcarpenter69](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/tlcarpenter69/32/1026_2.png) [@tlcarpenter69](https://farmos.discourse.group/u/tlcarpenter69)\
**Post date:** [March 15, 2024, 5:00pm UTC](https://farmos.discourse.group/t/the-website-encountered-an-unexpected-error-try-again-later/1933/10 "2024-03-15T17:00:11Z")

</div>

I don’t know if it’s me or what…but I can’t find the current version in any of the farm\_ledger files in the directory.

---

<div class="post-metadata">

**Author:** ![mstenta](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/mstenta/32/4_2.png) [@mstenta](https://farmos.discourse.group/u/mstenta)\
**Post date:** [March 15, 2024, 5:02pm UTC](https://farmos.discourse.group/t/the-website-encountered-an-unexpected-error-try-again-later/1933/11 "2024-03-15T17:02:35Z")

</div>

If you downloaded it from [Drupal.org](http://Drupal.org), then the `farm_ledger.info.yml` file would have the version inserted into it via [Drupal.org](http://Drupal.org) packaging script. If you used `git clone` then it wouldn’t say, but you could check the commit you’re on.

---

<div class="post-metadata">

**Author:** ![mstenta](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/mstenta/32/4_2.png) [@mstenta](https://farmos.discourse.group/u/mstenta)\
**Post date:** [March 15, 2024, 5:03pm UTC](https://farmos.discourse.group/t/the-website-encountered-an-unexpected-error-try-again-later/1933/12 "2024-03-15T17:03:59Z")

</div>

If you don’t have any sale/purchase logs, you could also just uninstall that module and see if it fixes the error. But if you do have those logs, then updating it and running `drush updb` + `drush cr` should do the trick.

That said, it’s possible that the error you’re seeing is coming from another place too… but we’ll try `farm_ledger` first…

---

<div class="post-metadata">

**Author:** ![mstenta](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/mstenta/32/4_2.png) [@mstenta](https://farmos.discourse.group/u/mstenta)\
**Post date:** [March 15, 2024, 5:05pm UTC](https://farmos.discourse.group/t/the-website-encountered-an-unexpected-error-try-again-later/1933/13 "2024-03-15T17:05:17Z")

</div>

PS: Here is where we identified that issue originally… it was present in a number of modules… which is why I say it may be coming from elsewhere too…

> <https://github.com/farmOS/farmOS/issues/759>
>
> After creating a fresh farmOS 2.2.1 install, updating it to 3.0.0-beta3, and the…n installing all modules in \`/setup/modules\` I'm seeing the following error appear frequently in logs:
> 
> \`\`\`
> Drupal\\Component\\Plugin\\Exception\\PluginNotFoundException: The "d7\_asset" plugin does not exist. Valid plugin IDs for Drupal\\migrate\\Plugin\\MigrateSourcePluginManager are: csv\_file, embedded\_data, empty, table, url, csv in Drupal\\Core\\Plugin\\DefaultPluginManager-\>doGetDefinition() (line 53 of /opt/drupal/web/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php).
> \`\`\`

---

<div class="post-metadata">

**Author:** ![tlcarpenter69](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/tlcarpenter69/32/1026_2.png) [@tlcarpenter69](https://farmos.discourse.group/u/tlcarpenter69)\
**Post date:** [March 15, 2024, 5:06pm UTC](https://farmos.discourse.group/t/the-website-encountered-an-unexpected-error-try-again-later/1933/14 "2024-03-15T17:06:06Z")

</div>

Apparently I used git. I did a git pull and the drush commands. It did some upgrades.

AND…

That fixed it! I am able to login now.

and in the process learned the proper way to upgrade things,.

Thank you very much! You saved my bacon (well, we don’t have pigs we have cows).

---

<div class="post-metadata">

**Author:** ![mstenta](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/mstenta/32/4_2.png) [@mstenta](https://farmos.discourse.group/u/mstenta)\
**Post date:** [March 15, 2024, 5:09pm UTC](https://farmos.discourse.group/t/the-website-encountered-an-unexpected-error-try-again-later/1933/15 "2024-03-15T17:09:11Z")

</div>

Hooray! I love it when things work! 😄

And yea, now that you know the process future upgrades should be straightforward. Just be sure to “pin” the version of farmOS you’re using in your `docker-compose.yml` file, so that you can make your updates intentionally. It’s also a good idea to update all your add-on modules at the same time, if there are new versions available. Sometimes they update to match changes in core farmOS.

---

<div class="post-metadata">

**Author:** ![mstenta](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/mstenta/32/4_2.png) [@mstenta](https://farmos.discourse.group/u/mstenta)\
**Post date:** [March 15, 2024, 5:09pm UTC](https://farmos.discourse.group/t/the-website-encountered-an-unexpected-error-try-again-later/1933/16 "2024-03-15T17:09:58Z")

</div>

If you want to take your self-hosting to the next level (using true dependency management tools), this is what I would recommend reading next: [Building farmOS with Composer | farmOS](https://farmos.org/hosting/composer/)

---

<div class="post-metadata">

**Author:** ![tlcarpenter69](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/tlcarpenter69/32/1026_2.png) [@tlcarpenter69](https://farmos.discourse.group/u/tlcarpenter69)\
**Post date:** [March 15, 2024, 5:14pm UTC](https://farmos.discourse.group/t/the-website-encountered-an-unexpected-error-try-again-later/1933/17 "2024-03-15T17:14:14Z")

</div>

Thanks, I’ll be sure to check that out. I’ll admit to taking shortcuts on the upgrades, so now I’ll be doing it right going forward.

I’ve gone through the other plugins to be sure they are up-to-date.
