Mastra sample code not working
Hey @Abhi Aiyer and @roamin ,
I realize my response on the last post was a bit late since I was a conference last week and did not have time to reply. I saw that @Abhi Aiyer told me to open a new post. It seem like the sample still has some issues, the RDS instance is connecting now but app itself seem to broken in some ways after you updated the Mastra packages.
Here are the two issues I’m seeing:
I will breaking this messages in chunks because of discord content window limits, there is more below.
14 Replies
1. Octokit appears to be misconfigured (rate limiting too quickly)
It seems like Octokit may not be configured correctly, because I’m hitting rate limits after very few
requests. The environment variable is being picked up — here’s how Octokit is initialized:
Despite that, I still get this error when hosting it on AWS:
Request quota exhausted for request GET /repos/{owner}/{repo}
I am also getting these warning about octokit which might be related to this issue:
2. Next.js redirect
When loading the site, I hit a redirect error when running locally. After clicking a repository title, the first
request fails with:
But clicking again makes it work.
But the browser goes white with:
Application error: a client-side exception has occurred...
If I click the refresh the page then it enter the chatbox ui and then work.
If I want to chat to another repo then this cycle of troubleshooting start again for any other repo link.
Are you using a GITHUB_TOKEN? Authenticated GH requests have higher request quotas
The octokit log isn't really an error and being logged by nextjs
📝 Created GitHub issue: https://github.com/mastra-ai/mastra/issues/10473
🔍 If you're experiencing an error, please provide a minimal reproducible example whenever possible to help us resolve it quickly.
🙏 Thank you for helping us improve Mastra!
Found the issues, fixing!
Pushed a fix to the repo on
main. We had some react issues and some redirect problems. Looks fixed on my end!Yes I have the
GITHUB_TOKEN set, I even made another GITHUB_TOKEN on my dummy account and it exhausted the limit on that too.
At one point my token got exhausted hosting on AWS, my copilot log me out on my vscode. I had to wait to the next day until my limit reset.Let me see if i can make it reduce the amount of fetches to GH
Alright i pushed another change that makes the initial repo list static, and adjusted some tools. Any other changes please feel free to contribute to repo-base
@Abhi Aiyer Please have a look when you have time: https://github.com/mastra-ai/repo-base/pull/1
GitHub
Refactors project structure and streamlines Docker setup by KevyVo ...
Moves application files to a dedicated app directory to introduces a Dockerfile for containerized development. Replaces the old docker-compose.yml with compose.yaml to align with Docker Compose v2 ...
When a user runs this project, they only need to provide the GOOGLE_GENERATIVE_AI_API_KEY—either by setting it in a .env file or defining it directly in the Compose file. The Docker Compose setup also includes hot reloading, so the entire stack becomes ready to use with a single command: docker compose up. This brings the project one step closer to being production-ready.
And also a toggle for SSL.
Please pull the changes and run
docker compose up, if you like to test it before considering to merge the PR.Awesome thank you for this, I will take a look
There was not to much changed, as you see most of the non important diff was just moving the code into a new directory call /app. so if you see 77 changed there really only 3 files added, most of it was moving location. I would'nt dump such a big PR on you 😁 .
Merged!
Hey @Abhi Aiyer ,
I realized after deploying to Vercel that the previous directory structure wasn’t compatible with Vercel. I’ve reverted the project back to your original structure, but kept all the Docker-related improvements. This means local Docker development still works seamlessly with hot reloading and user no longer need to do
pnpm install since that is handle by the dockerfile. The project is now properly aligned with Vercel’s deployment requirements.
Sorry for the back and forth and taking up your valuable time. I only realize this after deploying to Vercel. Anyways this fix would only benefit Mastra users.
PR: https://github.com/mastra-ai/repo-base/pull/2
Please approve when you have time, it only a small PR with a diff of 10 lines. Most it was just moving the files out to be Vercel friendly. If you like to confirm the working state, please pull the branch and run docker compose up.Merged!