# Log not Synching to Database

**URL:** <https://farmos.discourse.group/t/log-not-synching-to-database/515>\
**Category:** Field Kit\
**Created:** [October 12, 2020, 10:47am UTC](https://farmos.discourse.group/t/log-not-synching-to-database/515 "2020-10-12T10:47:29Z")\
**Posts on this page:** 4\
**Page:** 2

<div class="post-metadata">

**Author:** ![graffte](https://avatars.discourse-cdn.com/v4/letter/g/b38774/32.png) [@graffte](https://farmos.discourse.group/u/graffte)\
**Post date:** [October 13, 2020, 9:38pm UTC](https://farmos.discourse.group/t/log-not-synching-to-database/515/21 "2020-10-13T21:38:48Z")

</div>

So first you’d have to know what “413” meant. For me, the error message was covered by a banner notice on my phone User Interface. Only saw it when I started digging deeper into the issue. If I run into future problems, I’ll look for the error messages.

---

<div class="post-metadata">

**Author:** ![Symbioquine](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/symbioquine/32/284_2.png) [@Symbioquine](https://farmos.discourse.group/u/Symbioquine)\
**Post date:** [October 13, 2020, 11:33pm UTC](https://farmos.discourse.group/t/log-not-synching-to-database/515/22 "2020-10-13T23:33:04Z")

</div>

> [@graffte](#):
>
> So first you’d have to know what “413” meant.

No, presumably Field Kit should in the future translate the HTTP status 413 code into something more intelligible to the user - i.e. “Syncing failed because included data is too large. Try syncing individual logs and/or using resized versions of any images.”

> [@graffte](#):
>
> For me, the error message was covered by a banner notice on my phone User Interface.

That sounds like an issue that might need addressing separately…

---

<div class="post-metadata">

**Author:** ![jgaehring](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/jgaehring/32/927_2.png) [@jgaehring](https://farmos.discourse.group/u/jgaehring)\
**Post date:** [October 14, 2020, 12:46am UTC](https://farmos.discourse.group/t/log-not-synching-to-database/515/23 "2020-10-14T00:46:07Z")

</div>

> [@Symbioquine](#):
>
> Field Kit might not know what the limit is ahead of time. However, it seems like the farmOS server should respond with [HTTP status 413](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/413) which would at least let Field Kit tell the user why the log upload failed after the fact…

I’m hazy on how the server works in these situations, but it might be difficult to get a coherent message from the server if this is indeed the PHP config rejecting it. I’m not sure if that gives the server logic the opportunity to respond with anything intelligible or if it just bails. Field Kit should be displaying both the status code (413) and the human-readable message, as long as there is one. But guessing from the error messages @graffte posted in [the other topic](https://farmos.discourse.group/t/error-the-website-encountered-an-unexpected-error-please-try-again-later/502/7), it looks like neither a status code nor a error message was provided. Hence the opaque “Network Error” message. That reinforces for me that the PHP interpreter is in fact just bailing on the request, before a status code/message can be generated, but perhaps @mstenta would have more insights into this.

In any event, we will be implementing some sane limits on images in the future, so those should prevent these kinds of errors client-side.

---

<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:** [October 14, 2020, 1:11am UTC](https://farmos.discourse.group/t/log-not-synching-to-database/515/24 "2020-10-14T01:11:18Z")

</div>

I misspoke earlier. It was actually Nginx that prevented the request, with the following error message:

> client intended to send too large body

I don’t think Nginx sent a 413 (and that seems corroborated by the lack of error message in Field Kit).

> In any event, we will be implementing some sane limits on images in the future, so those should prevent these kinds of errors client-side.

Yea I’m curious if we could send them in multiple requests…

> send the files individually, and confirm that each works on its own

If so, then we could track individual file upload status. Files are entities in farmOS 2.x, so they’ll have their JSON:API resource endpoint - although I’m not sure how the actual file upload process will work with JSON:API - if it’s similar base64 encoded request body, or what…

This is speaking “ideally” - we’ll see what’s feasible in practice. 🙂

[Previous page](https://farmos.discourse.group/t/log-not-synching-to-database/515.md?page=1)
