Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UpstashTransport log drains throws 'transportId is required' #1973

Open
Benyon opened this issue Feb 20, 2025 · 1 comment
Open

UpstashTransport log drains throws 'transportId is required' #1973

Benyon opened this issue Feb 20, 2025 · 1 comment
Labels
bug Something isn't working Documentation Improvements or additions to documentation

Comments

@Benyon
Copy link

Benyon commented Feb 20, 2025

In Mastra, when adding a logger using UpstashTransport, the Log Drains feature in the playground throws an error:

"transportId is required"

This happens even when following the official guide:
Upstash Logger Remote Log Drain

Steps to Reproduce:

Scaffold a new project using create-mastra@latest
Create a new Redis Upstash using Upstash.com
Add a logger using UpstashTransport from @mastra/loggers
Run the mastra server
Go to weather workflow, enter a city and submit
Go to the Log Drains section in the playground.
Observe the error.

Expected Behavior:
Log drains should function without requiring an explicit transportId.

Environment:

@mastra/core verson: 0.2.1
@mastra/loggers: 0.1.1

Console Output:

Error getting logs by run ID HTTPException [Error]: transportId is required
    at getLogsByRunIdHandler (file:///Users/<username>/Desktop/mastra-agent-app/.mastra/output/index.mjs:5165:13)
    at dispatch (file:///Users/<username>/Desktop/mastra-agent-app/.mastra/output/index.mjs:486:23)
    at file:///Users/<username>/Desktop/mastra-agent-app/.mastra/output/index.mjs:486:46
    at Object.assign.resolver (file:///Users/<username>/Desktop/mastra-agent-app/.mastra/output/index.mjs:2916:15)
    at dispatch (file:///Users/<username>/Desktop/mastra-agent-app/.mastra/output/index.mjs:486:23)
    at file:///Users/<username>/Desktop/mastra-agent-app/.mastra/output/index.mjs:486:46
    at file:///Users/<username>/Desktop/mastra-agent-app/.mastra/output/index.mjs:5875:11
    at dispatch (file:///Users/<username>/Desktop/mastra-agent-app/.mastra/output/index.mjs:486:23)
    at file:///Users/<username>/Desktop/mastra-agent-app/.mastra/output/index.mjs:486:46
    at cors2 (file:///Users/<username>/Desktop/mastra-agent-app/.mastra/output/index.mjs:2118:11) {
  res: undefined,
  status: 400,
  [cause]: undefined
}

Code:

// src/mastra/index.ts

import { Mastra } from "@mastra/core/mastra";
import { createLogger } from "@mastra/core/logger";
import { UpstashTransport } from "@mastra/loggers/upstash";
import { weatherWorkflow } from "./workflows";
import { weatherAgent } from "./agents";

export const mastra = new Mastra({
  workflows: { weatherWorkflow },
  agents: { weatherAgent },
  logger: createLogger({
    name: "Mastra",
    level: "info",
    transports: {
      upstash: new UpstashTransport({
        listName: "dev-logs",
        upstashUrl: process.env.UPSTASH_URL!,
        upstashToken: process.env.UPSTASH_TOKEN!,
      }),
    },
  }),
});
Weather workflows and tools are the same as scaffolded.

Additional Context:

Logs do get created in Upstream when first serving mastra with npm run dev

Would appreciate a fix or guidance on resolving this.

@github-actions github-actions bot added bug Something isn't working Documentation Improvements or additions to documentation labels Feb 20, 2025
@abhiaiyer91
Copy link
Contributor

@Benyon to be honest with you I dont think that feature ever worked and we hoped people wouldn't notice :P. Now that you noticed guess we have to fix it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants