MD AMIR SOHAIL
MD AMIR SOHAIL
CDCloudflare Developers
Created by MD AMIR SOHAIL on 10/29/2024 in #pages-help
Cloudflare API returned non-200: 500
When i am trying to deploy getting this error. Previously there is no issue with deployment but today i am getting this error. Cloudflare API returned non-200: 500 API returned: { "result": null, "success": false, "errors": [ { "code": 8000000, "message": "An unknown error occured. Contact your account team or Cloudflare support: https://cfl.re/3WgEyrH." } ], "messages": [] }
2 replies
CDCloudflare Developers
Created by MD AMIR SOHAIL on 10/24/2024 in #general-help
I am using R2 to upload images, But uploaded images not available in bucket
Subject: Image Upload to Cloudflare R2 Shows Successful but Files Not Appearing in Bucket Hello, I have configured my Cloudflare Worker to upload images to an R2 bucket. The upload process completes successfully, and the response indicates that the files have been uploaded. However, when I check the R2 bucket, the images are not visible. Here are the key details of my issue: The response from the Worker after the upload is successful, but the files are not appearing in the R2 dashboard. The Worker is using the put() method with the image file and correct content type (e.g., 'image/png'). I have verified that the bucket permissions are set correctly for the Worker. There are no apparent errors in the Worker logs. Could you please assist me in troubleshooting why the uploaded files are not appearing in the R2 bucket, despite the successful response?
response":{"storageClass":"","customMetadata":{},"httpMetadata":{},"uploaded":"2024-10-24T11:38:08.013Z","checksums":{"md5":"86cc1e9865dba3eaf86acc134f4ce126"},"httpEtag":"\"86cc1e9865dba3eaf86acc134f4ce126\"","etag":"86cc1e9865dba3eaf86acc134f4ce126","size":52733,"version":"fda1b9d832f442bf6f7de8f83a2ebba1","key":"client_03345jsfidfh7w68cde3wc_Screenshot_2024-10-24_at_5png"}
response":{"storageClass":"","customMetadata":{},"httpMetadata":{},"uploaded":"2024-10-24T11:38:08.013Z","checksums":{"md5":"86cc1e9865dba3eaf86acc134f4ce126"},"httpEtag":"\"86cc1e9865dba3eaf86acc134f4ce126\"","etag":"86cc1e9865dba3eaf86acc134f4ce126","size":52733,"version":"fda1b9d832f442bf6f7de8f83a2ebba1","key":"client_03345jsfidfh7w68cde3wc_Screenshot_2024-10-24_at_5png"}
Code const response = await env.MY_BUCKET.put(uniqueFileName, file.stream(), { httpMetadata: { "Content-Type": "multipart/form-data", }, });
2 replies
CDCloudflare Developers
Created by MD AMIR SOHAIL on 8/19/2024 in #workers-help
How to migrate/ set region for worker.
I have observed the following regarding the latency and query response times: * Database Location: AWS ap-south-1 (Mumbai) * Server Location: California (San Francisco) * User Access Sites: Hyderabad, US Latencies: 1. California to Mumbai: 150 ms to 250 ms 2. Hyderabad to California: 200 ms to 300 ms 3. Mumbai to California: 150 ms to 250 ms 4. California to Hyderabad: 200 ms to 300 ms Round-Trip Time (RTT): * RTT: 400 ms to 600 ms Query Time: * Single Query Time: 700 ms to 1,100 ms For instance, when retrieving a project and processing all related data—such as actions, sections, deliverables, document editor, and content_block, associations and action cashing logic. Imaging Below use case. 1. 10 RTTs with the Database: Maximum of 5.6 seconds 2. Time for Processing (Payload creation, caching logic, etc.): Additional time Total Time for 10 Queries: * RTT: 5.6 seconds * RTT for Client-Server Communication: 1.1 seconds * Processing Time: 1 second Total Estimated Time: 7.7 seconds Currently, the client is receiving responses within 7 to 8 seconds, which aligns with the calculated time. How i can migrate my server to India Mumbai region, I need to restrict it to serve from Mumbai based data center only no matter from where request is coming.
15 replies
CDCloudflare Developers
Created by MD AMIR SOHAIL on 6/10/2024 in #pages-help
how to configure branches to deploy in production not in preview mode ?
I am using git flow and using workflow to deploy. When i am deploying from main branch it is going to production environment, if deployed from any other branch it shows preview. I need to deploy in production environment from main and as well as branch with prefix release (release/*). I am not able to do that. below is my workflow file. Basically my production deployment branch is main and i need to replace main with wildcard branch called release/**
2 replies
CDCloudflare Developers
Created by MD AMIR SOHAIL on 3/14/2024 in #workers-help
Not able to Integrate sentry with my worker
No description
4 replies
CDCloudflare Developers
Created by MD AMIR SOHAIL on 1/21/2024 in #pages-help
I am suddenly facing issue with worker deployment today previously it was working fine.
Below is the deployment issue which i am getting.
Run cloudflare/pages-action@1
with:
apiToken: ***
accountId: ***
projectName: client-staging
directory: ./apps/client-app/dist
gitHubToken: ***
wranglerVersion: 3
▲ [WARNING] `wrangler pages publish` is deprecated and will be removed in the next major version.

Please use `wrangler pages deploy` instead, which accepts exactly the same arguments.


Uploading... (5/5)
✨ Success! Uploaded 0 files (5 already uploaded) (0.24 sec)


✘ [ERROR] A request to the Cloudflare API (/accounts/***/pages/projects/client-staging/deployments) failed.

An unknown error occured. Contact your account team or Cloudflare support: https://cfl.re/3WgEyrH. [code: 8000000]

If you think this is a bug, please open an issue at: https://github.com/cloudflare/workers-sdk/issues/new/choose


npm notice
npm notice New major version of npm available! 9.5.1 -> 10.3.0
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v10.3.0>
npm notice Run `npm install -g [email protected]` to update!
npm notice
EXIT WHEN NOT EXPECTED

SHELLAC COMMAND FAILED!
Executing: npx wrangler@3 pages publish "./apps/client-app/dist" --project-name="client-staging" --branch="" in /home/runner/work/collab/collab

STDOUT:

Uploading... (5/5)
✨ Success! Uploaded 0 files (5 already uploaded) (0.24 sec)
Run cloudflare/pages-action@1
with:
apiToken: ***
accountId: ***
projectName: client-staging
directory: ./apps/client-app/dist
gitHubToken: ***
wranglerVersion: 3
▲ [WARNING] `wrangler pages publish` is deprecated and will be removed in the next major version.

Please use `wrangler pages deploy` instead, which accepts exactly the same arguments.


Uploading... (5/5)
✨ Success! Uploaded 0 files (5 already uploaded) (0.24 sec)


✘ [ERROR] A request to the Cloudflare API (/accounts/***/pages/projects/client-staging/deployments) failed.

An unknown error occured. Contact your account team or Cloudflare support: https://cfl.re/3WgEyrH. [code: 8000000]

If you think this is a bug, please open an issue at: https://github.com/cloudflare/workers-sdk/issues/new/choose


npm notice
npm notice New major version of npm available! 9.5.1 -> 10.3.0
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v10.3.0>
npm notice Run `npm install -g [email protected]` to update!
npm notice
EXIT WHEN NOT EXPECTED

SHELLAC COMMAND FAILED!
Executing: npx wrangler@3 pages publish "./apps/client-app/dist" --project-name="client-staging" --branch="" in /home/runner/work/collab/collab

STDOUT:

Uploading... (5/5)
✨ Success! Uploaded 0 files (5 already uploaded) (0.24 sec)
3 replies
CDCloudflare Developers
Created by MD AMIR SOHAIL on 11/24/2023 in #workers-help
Issue with Cors Header Blocking : Cloudflare Worker.
No description
3 replies
CDCloudflare Developers
Created by MD AMIR SOHAIL on 10/31/2023 in #pages-help
anyone can help me with cloudflare pages i am trying to add CNAME but getting error inactive(error)
No description
22 replies
CDCloudflare Developers
Created by MD AMIR SOHAIL on 7/27/2023 in #pages-help
Deploy on cloudflere Pages with github actions fails.
I am trying to auto deploy my project to cloudflare pages when there push in the staging branch or in production branch. below is my yml file for staging.
name: Publish Staging

on:
push:
branches:
- staging
pull_request:
types:
- synchronize

jobs:
publish:
runs-on: ubuntu-latest

permissions:
contents: read
deployments: write

strategy:
matrix:
include:
- projectName: "portal-staging"

steps:
- name: Checkout 🛎
uses: actions/checkout@v3

- name: Setup node env 🏗
uses: actions/setup-node@v3
with:
node-version: 18.16.1
cache: "yarn"

- name: Install dependencies 👨🏻‍💻
run: yarn

- name: Run build
run: yarn portal:build

- name: Publish
uses: cloudflare/pages-action@1
with:
apiToken: ${{ secrets.CLOUDFLARE_STAGING_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_STAGING_ACCOUNT_ID }}
projectName: ${{ matrix.projectName }}
directory: ./apps/portal/dist
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
name: Publish Staging

on:
push:
branches:
- staging
pull_request:
types:
- synchronize

jobs:
publish:
runs-on: ubuntu-latest

permissions:
contents: read
deployments: write

strategy:
matrix:
include:
- projectName: "portal-staging"

steps:
- name: Checkout 🛎
uses: actions/checkout@v3

- name: Setup node env 🏗
uses: actions/setup-node@v3
with:
node-version: 18.16.1
cache: "yarn"

- name: Install dependencies 👨🏻‍💻
run: yarn

- name: Run build
run: yarn portal:build

- name: Publish
uses: cloudflare/pages-action@1
with:
apiToken: ${{ secrets.CLOUDFLARE_STAGING_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_STAGING_ACCOUNT_ID }}
projectName: ${{ matrix.projectName }}
directory: ./apps/portal/dist
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
I am getting error like below when github action starts running.
Error: Failed to get Pages project, API returned non-200
at getProject (/home/runner/work/_actions/cloudflare/pages-action/1/index.js:22082:13)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async /home/runner/work/_actions/cloudflare/pages-action/1/index.js:22167:21
Error: Failed to get Pages project, API returned non-200
at getProject (/home/runner/work/_actions/cloudflare/pages-action/1/index.js:22082:13)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async /home/runner/work/_actions/cloudflare/pages-action/1/index.js:22167:21
2 replies