https://discord.cloudflare.com logo
Join Discord
Powered by
# workers-discussions
  • w

    Walshy | Pages

    05/28/2023, 3:39 PM
    A 502 from a Worker isn't something I'd expect. If you ran out of CPU time you'd get a proper error. 502 comes from us trying to hit your origin
  • w

    Walshy | Pages

    05/28/2023, 3:40 PM
    Are you trying to hit your origin / an external service? If so, I think the problem is from there
  • s

    semicolondev

    05/28/2023, 3:40 PM
    GPT4 is taking longer > 1.3s but worker itself is getting timed out in 1.2s Should I switch to Lambda? I need to switch ASAP, I'm sorta losing 💵
  • w

    Walshy | Pages

    05/28/2023, 3:40 PM
    1 second is nothing
  • s

    semicolondev

    05/28/2023, 3:41 PM
    OpenAI but I tried it from playground and it's working fine 🤔
  • e

    Erisa | Support Engineer

    05/28/2023, 3:41 PM
    even our default http timeout is 100 seconds
  • w

    Walshy | Pages

    05/28/2023, 3:41 PM
    OpenAI's internal APIs and external APIs are different
  • e

    Erisa | Support Engineer

    05/28/2023, 3:41 PM
    but if its actively streaming data that won't be hit either
  • w

    Walshy | Pages

    05/28/2023, 3:41 PM
    Do you have a curl we can run to see the behaviour?
  • e

    Erisa | Support Engineer

    05/28/2023, 3:42 PM
    and also yeah my first thought for 502 from a worker is that its being thrown from an upstream origin
  • s

    semicolondev

    05/28/2023, 3:42 PM
    I'm not streaming, it's just normal HTTP request
  • s

    semicolondev

    05/28/2023, 3:49 PM
    If it's thrown from upstream, I should get the error in try catch right?
  • s

    semicolondev

    05/28/2023, 3:49 PM
    Can I DM you?
  • w

    Walshy | Pages

    05/28/2023, 3:50 PM
    yep
  • w

    Walshy | Pages

    05/28/2023, 3:50 PM
    No, it won't be in catch
  • w

    Walshy | Pages

    05/28/2023, 3:50 PM
    otherwise you'd see an exception
  • w

    Walshy | Pages

    05/28/2023, 3:50 PM
    you can check the status code though
  • s

    semicolondev

    05/28/2023, 3:51 PM
    I'm running it via Postman

    https://cdn.discordapp.com/attachments/779390076219686943/1112407902930608138/image.png▾

  • e

    Erisa | Support Engineer

    05/28/2023, 3:53 PM
    Whats the response body?
  • s

    semicolondev

    05/28/2023, 3:54 PM
    Strange, if I run it on local I'm getting 504 but I deployed it to staging (to share curl) it's working now 🤦‍♂️
  • s

    semicolondev

    05/28/2023, 3:56 PM

    https://cdn.discordapp.com/attachments/779390076219686943/1112409049577836544/image.png▾

  • o

    Olig

    05/28/2023, 6:57 PM
    Hey, quick question, I can access the geo location data inside a worker using the headers, but is there any way to do this from a given IP address? Or like change the IP and force a refresh of the data?
  • p

    Plotzes

    05/28/2023, 7:00 PM
    i dont think so, you'd have to use a 3rd party API to get geo data from any given IP address
  • h

    HardAtWork

    05/28/2023, 8:36 PM
    Download MaxMind yourself, and dump to KV maybe?
  • s

    silence

    05/28/2023, 9:52 PM
    This happens to me too often, then i just click retry deployment and it works after a few seconds. my app literally takes like 20 seconds to build and deploy so that's very annoying

    https://cdn.discordapp.com/attachments/779390076219686943/1112498651558854696/image.png▾

  • s

    silence

    05/28/2023, 9:54 PM
    it only happens when we add new files.

    https://cdn.discordapp.com/attachments/779390076219686943/1112499129520762920/image.png▾

  • o

    Olig

    05/29/2023, 3:08 AM
    Yea there are lots of options, was just hoping there was a quick way / function to do it since CF use Maxmind to add the geolocation headers in the first place.
  • will there ever be a new version of the
    b

    Ben-xD

    12/18/2023, 11:49 PM
    I wonder that as well. On https://cloudflareapps.com/apps/category/all, it says > Cloudflare Apps is no longer accepting new submissions. > > We're building a new Apps experience, if you're interested sign up here.
    c
    u
    a
    • 4
    • 3
  • hi, Update our worker.js script to include a connect() function that returns a TCP socket, i.e., Goo
    d

    devced_46565

    12/24/2023, 1:35 AM
    Hi, Can we update our worker.js script to include a connect() function that returns a TCP socket, i.e., Google IAP for TCP forwarding webhook between Cloudflare Worker and an internal ip address hosting our SMTP server at ‘imap-cfored-com:10025.’, https://developers.cloudflare.com/workers/runtime-apis/tcp-sockets/#connections-to-port-25-are-prohibited Regards, Hal
  • What is the best way to throttle api to
    s

    socal619

    01/08/2024, 1:56 AM
    Workers have no concept of time so this is where i'm running into issues
    s
    e
    • 3
    • 6