sortofsleepy
CCConvex Community
•Created by sortofsleepy on 2/3/2025 in #support-community
Issues running Convex Python client behind Docker
I'm running into an interesting issue while trying to utilize the Python sdk on a simple Flask application running on Gunicorn behind Docker.
First off, the application works perfectly fine when not behind Docker. Usage of the sdk is fine. However the moment I set the application up behind Docker, any requests using the sdk suddenly timeout and I just get a stacktrace pointing to the sdk function called.
Looking through the docs for the sdk I noticed that there are technically 2 client objects, a websocket based one and an http one, my guess is I'm not exposing whatever port the websocket is trying to communicate through as the http client appears to work fine. My devops knowledge is a little rusty; is there a way to get which port I need to open? Port 80 and 443 are open already. Or is there another trick to working with Docker? I don't mind using the http client but given that it's mentioned as being "Legacy", it'd be nice to move onto the newer class. (as a side note, it might be good to remove the
Looking through the docs for the sdk I noticed that there are technically 2 client objects, a websocket based one and an http one, my guess is I'm not exposing whatever port the websocket is trying to communicate through as the http client appears to work fine. My devops knowledge is a little rusty; is there a way to get which port I need to open? Port 80 and 443 are open already. Or is there another trick to working with Docker? I don't mind using the http client but given that it's mentioned as being "Legacy", it'd be nice to move onto the newer class. (as a side note, it might be good to remove the
set_debug
mention in the readme; unless it's somewhere else I missed, I got an error saying the method doesn't exist on ConvexClient
)
Thank you.16 replies
CCConvex Community
•Created by sortofsleepy on 10/6/2024 in #support-community
npx convex import - always pushes to the same/wrong project
👋
Trying to get some test data into a table and for whatever reason, whenever I run
npx convex import
... , the data always gets written to the wrong project in my account.
- I only have 2 projects in my account. Projects A & B. I would like to import data into project B. If it matters, project A was created first.
- Whenever I run the command, data is always written to project A.
- When first prompted to select a project, I am picking project B.
- I have also tried running npx convex dev --project B
- I have also tried starting over and was re prompted for which project to work with; I also chose project B then and the same issue occurs.
- I have also tried deleting project B and re-creating it via the cli but the issue persists.
- I have double checked the env file; it does appear to point to the correct project.
Ultimately I can just manually create everything but it'd be nice to not have to do so. Am I missing something?
Thanks! 🎉4 replies
CCConvex Community
•Created by sortofsleepy on 10/2/2024 in #support-community
Trying to generate a OpenAPI C client - repeatedly fails to generate "any_type.h"
👋
Trying to explore and see if Convex might be a good choice for a simple side project. I'm basically looking to interact with Convex through a Zig application.
That being the case, it seemed like generating a C client is the right call, unfortunately the generator appears to constantly fail to generate the necessary files. When I go to build, the compiler keeps complaining about a missing file called
Not sure whether it's an issue with the spec generator or OpenAPI itself; figured I'd ask here first. If it matters I'm on Windows. For reference, this is pretty much the api I need:
any_type.h
Not sure whether it's an issue with the spec generator or OpenAPI itself; figured I'd ask here first. If it matters I'm on Windows. For reference, this is pretty much the api I need:
import {mutation, query} from "./_generated/server";
import {v} from "convex/values"
export const get = query({
args: {}, handler: async (ctx) => {
return await ctx.db.query("links").collect()
}
})
export const add = mutation({
args: {
label: v.string(),
city: v.string(),
ip: v.string(),
link_id: v.string()
},
handler: async (ctx, args) => {
return await ctx.db.insert("stats", {...args})
}
})
Thank you!🎉19 replies