GithubHelp home page GithubHelp logo

Argument `websiteId` is missing. about umami HOT 5 OPEN

oliverzgy avatar oliverzgy commented on June 15, 2024
Argument `websiteId` is missing.

from umami.

Comments (5)

franciscao633 avatar franciscao633 commented on June 15, 2024

Both sessionId and websiteId are non-nullable columns, so it should fail. Just wondering how it got to this state. This was produced from the tracker and not a custom payload?

from umami.

obstkompost avatar obstkompost commented on June 15, 2024

Found the Same Error in the Logs of a self-hosted umami:

PrismaClientValidationError:
Invalid prisma.websiteEvent.create() invocation:
{
data: {
id: "XXXXXXXXXXXXXXXXXXXXXXX",
sessionId: undefined,
visitId: "XXXXXXXXXXXXXXXXXXXXXXXX",
urlPath: "#/XXXXXXXXXXXX",
urlQuery: undefined,
referrerPath: "#/",
referrerQuery: undefined,
referrerDomain: "",
pageTitle: "XXXXXXXXXXXXXXX",
eventType: 1,
eventName: null,

  • websiteId: String
    }
    }
    Argument websiteId is missing.
    at Tn (/app/node_modules/@prisma/client/runtime/library.js:115:5888)
    at In.handleRequestError (/app/node_modules/@prisma/client/runtime/library.js:122:6510)

Client Version:5.11.0

from umami.

CTHRU avatar CTHRU commented on June 15, 2024

[EDIT] The custom script was definitely a cause, but the error still pops up from time to time. If anyone has more info on this issue, I'm interested.

Fwiw, I had the same issue but the cause was outside Umami. Maybe the info can be of help to others too.

I had a custom script that called umami.track but I forgot to wait for the umami-script to be loaded.

  <script data-id="umami-script" defer src="..." data-website-id="..."></script>

<script type="text/javascript">
    function myTracker(eventName, eventData) {
    ...
    umami.track(eventName, eventData);
    }
</script>

This randomly failed with the above mentioned error, due to the umami script not being loaded yet when myTracker was called. The solution was to add a listener for the umami-script to be loaded, like so:

<script data-id="umami-script" defer src="..." data-website-id="..."></script>

<script type="text/javascript">
    function myTracker(eventName, eventData) {
       document.querySelector('script[data-id="umami-script"]').addEventListener('load', function () {
          ...
          umami.track(eventName, eventData);
       });
    }
</script>

[EDIT 2] In my case, if my web app would call the myTracker() function before the script was loaded, this would cause the event not to be generated. I removed the defer option from the umami-script line to make sure it loads before the app starts, delays are negligable. So now I have:

<script data-id="umami-script" src="..." data-website-id="..."></script>

<script type="text/javascript">
    function myTracker(eventName, eventData) {
          ...
          umami.track(eventName, eventData);
    }
</script>

which seems to work fine. I'll report back if it wouldn't solve my issue.

from umami.

genki avatar genki commented on June 15, 2024

I also have the same issue today.

 Invalid `prisma.websiteEvent.create()` invocation:
   |
   | {
   |   data: {
   |     id: "********",
   |     sessionId: undefined,
   |     visitId: "*******",
   |     urlPath: "/",
   |     urlQuery: undefined,
   |     referrerPath: undefined,
   |     referrerQuery: undefined,
   |     referrerDomain: "",
   |     pageTitle: "******",
   |     eventType: 1,
   |     eventName: null,
   | +   websiteId: String
   |   }
   | }
   |
   | Argument `websiteId` is missing.
   |     at Tn (/app/node_modules/@prisma/client/runtime

I am using v2.11.2 at my own host.

from umami.

ndaidong avatar ndaidong commented on June 15, 2024

I got the same error. Umami v2.11.3, Postgres 16.2, docker container

Screenshot from 2024-05-16 20-51-33

from umami.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.