Cloudflare Developers

CD

Cloudflare Developers

Welcome to the official Cloudflare Developers server. Here you can ask for help and stay updated with the latest news

Join

Sub-request stuck in pending state.

I am attempting to create a Worker that sends request data to my Splunk server, however when doing the POST to my splunk server the request was getting stuck at pending, I have since changed the worker to do a GET to google.com and it is still marked as pending. Any thoughts would be helpful!...
No description

Rate Limiting not working in environments

Hi I have a rate limiter defined on my dev env as such: ``` [[env.dev.unsafe.bindings]] name = "RATE_LIMITER" type = "ratelimit"...

Binding R2 to page

Good day, i would like to bind a cloudflare r2 from another cloudflare account to a page on my account. is this possible? Or are binding possible just inside one account? I am also encountering issues with the wrangler CLI - the command 'wrangler r2 bucket' doesn't list a create option. How can i fix that?...

can you use `await import()` to import files instead of normal method?

getting TypeError: (intermediate value).main is not a function

I am trying to test locally getting a file from R2 bucket which i added via dashboard

I created a worker cron job and am testing locally via wrangler dev --test-scheduled. calling await env.MY_BUCKET.get('myfile.json'); returns null even though the file exists in my R2 bucket dashboard. Why is this the case?

When testing locally, how to write to prod KV, R2, or D1? NOT THE SIMULATED VERSION

It does not write to prod unless i deploy. I dont want this.

Error 521 invoking a worker

Hello, Today between 6:30 and 7:30 UTC, I received ~750 HTTP 521 errors trying to invoke my worker, which account for ~8% of error rate. I did not find anything on https://www.cloudflarestatus.com/, and I'm wondering if I got rate limited or if I can do something to avoid this problem in the future. I'm on a paid plan. I'm open to any ideas to investigate this, thank you 🙏...
No description

Investigating worker subrequest

Hello, According to the sub-request graph on my dashboard, it appears some of my workers are triggering a high amount of sub-request. For reference, I have a steady 5 worker invocations / s, each of them should be doing 1-3 sub-request. The request graph is completely flat but my sub-request graph shows high peaks. ...
No description

How to send logs from Cloudflare Worker to Apache Kafka

Hi, I'm not sure if this is the right place to ask this question, but does anyone know how I can send logs from Cloudflare Worker Script to my Kafka that is running on my local server? One way I would do this is use some kind of REST proxy or create a NodeJS service that collects the logs from the Cloudflare Worker and then send it to the Kafka. ...

Does ctx.waitUntil work with hyperdrive?

Hello I have the following worker that listens for notifications from a service. ```typescript export default { async fetch( request: Request,...

Is it expected that my workers log every request URL they get executed for?

Is it expected that my workers log every request URL they get executed for? What is the easiest way to write to the logs in the UI dashboard view or is that not possible? console.log does not do the trick and we have not setup wrangler successfully yet. Is there an alterantive or is wrangler the way to go?

Changed name of worker, now Upstash and Axiom calls inside worker email handler won't authenticate.

Have there been any recent updates to the email handler() or does changing a worker name impact how auth creds are passed to external services?

Queues taking 25 seconds to be consumed in development. Why?

In local development, when I have an api route that triggers a queue using hono, and the consumer simply console logs the message, for some reason it has a delay of 25 seconds before all the console logs come printing out. Any idea on why that is? I would have thought it would be instant...? Code is written with hono.js This is my producer:...

live stream lifecycle not working

I want to get the video uid to display the stream, but the lifecycle endpoint always gives this response ```json { isInput: true,...

Worker is rejecting machine-generated ESModule

I'm using Scala.js, Scala compiler for ECMAScript (like TypeScript). When I upload worker with scheduled handler, Cloudflare rejects content: The uploaded script has no registered event handlers. (10068). What kind of handler does Cloudflare accept? Only plain ESModule? Should I use old script style instead of ESModule? ...

Connecting to AWS RDS from a worker through a Cloudflare tunnel

Hey everyone, Anyone connected to AWS RDS from a worker through a Cloudflare tunnel before? I have an EC2 instance with cloudflared and an RDS Postgres database in the same VPC, and I want to connect to this database from a Worker. The setup on AWS should be correct—we can connect locally to the database through the WARP client. I also want to route our worker-database connection through this tunnel, but I can't get it to work. Directly connecting to the Aurora internal URL from the worker gives Error: proxy request failed, cannot connect to the specified address (while it works locally through the WARP client). I tried setting up a public hostname on the tunnel, but no luck (neither in the worker nor locally)....

My cloudflare R2 bucket was deleted due to forgotten payment. How can I restore it and make my payme

My cloudflare R2 bucket was deleted due to forgotten payment. How can I restore it and make my payment?
No description

Modifying/updating secrets from Worker

Quick question, can you update a secret/environment variable from within a worker and propagate it so it's up-to-date on the next request? (important that it's a secret)

How do I send traces from a worker to Grafana Tempo?

I am having a hard time getting traces to export from a worker to Grafana Tempo. Would appreciate any help on this.

[solved] Is there a way to implement a timeout on fetch and socket connections ?

Hello, as per the title, I have a worker that use fetch and sockets but would like to kill the connection if it takes longer than x to get a response. What would be the best way to implement this behavior ?