Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CVAT CORS issue when uploading large files #6201

Closed
pyhsudars opened this issue May 26, 2023 · 7 comments
Closed

CVAT CORS issue when uploading large files #6201

pyhsudars opened this issue May 26, 2023 · 7 comments
Labels
need info Need more information to investigate the issue

Comments

@pyhsudars
Copy link

pyhsudars commented May 26, 2023

Im hosting cvat in AWS ec2 instance. i'm using my custom domainname to hit the AWS application load balancer which eventually directs to ec2 instance where cvat containers are running.
I'm running the containers as follows
docker compose -f docker-compose.yml -f components/serverless/docker-compose.serverless.yml up -d --build
Note:- (I'm not using docker-compose.https.yml)

The problem i'm facing is that for smaller images(size < 1 MB), the annotation tasks are getting created and we could see that the api call happening is "https".
But, when i try to create tasks with bigger images (Size >1 MB) for annotation, those api calls are using "http" protocol and is not working fine. I'm getting cors error as follows.
"Could not create the task. Error: tus: failed to upload chunk at offset 0, caused by [object ProgressEvent], originated from request (method: PATCH,..........................."
When inspected using google chrome, we could see the issue is with "upload.js" file residing in "tus-client" folder.This is the file used to implement chunking option for big files .
Please let us know how we can resolve the issue

Error message displayed in console:
Mixed Content: The page at 'https://www.xx.com/tasks/create' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://www.xx.com/api/tasks/72/data/7c08e3a2-962f-44cc-a63d-31955475d81a'. This request has been blocked; the content must be served over HTTPS.
cvat-app.tsx:354 Error: tus: failed to upload chunk at offset 0, caused by [object ProgressEvent], originated from request (method: PATCH, url: http://www.xx.com/api/tasks/72/data/7c08e3a2-962f-44cc-a63d-31955475d81a, response code: n/a, response text: n/a, request id: n/a).

@bsekachev
Copy link
Member

@klakhov could you look at the issue?

@pyhsudars
Copy link
Author

@klakhov, @bsekachev , Any interesting updates regarding this?

@pyhsudars
Copy link
Author

Appreciate some help here

@azhavoro
Copy link
Contributor

azhavoro commented Jun 2, 2023

@pyhsudars please provide exact steps to reproduce. If you are not using docker-compose.https.yml, how did you set up https?

@azhavoro azhavoro added the need info Need more information to investigate the issue label Jun 2, 2023
@pyhsudars
Copy link
Author

pyhsudars commented Jun 10, 2023

Installed CVAT in aws ec2 instance by running below steps
##############################################################

sudo apt update
sudo apt install apt-transport-https ca-certificates curl gnupg lsb-release
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update

VERSION_STRING = 5:23.0.3-1ubuntu.20.04focal
sudo apt-get install docker-ce=$VERSION_STRING docker-ce-cli=$VERSION_STRING containerd.io docker-buildx-plugin docker-compose-plugin
sudo usermod -aG docker $USER

version=1.8.14
wget https://github.com/nuclio/nuclio/releases/download/${version}/nuctl-${version}-linux-amd64

sudo chmod +x nuctl-${version}-linux-amd64
sudo ln -sf $(pwd)/nuctl-1.8.14-linux-amd64 /usr/local/bin/nuctl

git clone https://github.com/opencv/cvat

cd cvat

git reset --hard 8a14ce8
sudo docker compose up -d

sudo docker exec -it cvat_server bash -ic 'python3 ~/manage.py createsuperuser'

sleep 10
echo "Healthcheck"
docker exec -t cvat_server python manage.py health_check

cd cvat
export CVAT_HOST= www.xx.com
echo "host is $CVAT_HOST"

echo "Healthcheck"
docker exec -t cvat_server python manage.py health_check

docker compose -f docker-compose.yml -f components/serverless/docker-compose.serverless.yml up -d --build

#create and deploy a nuctl project
nuctl create project cvat-v2
nuctl deploy --project-name cvat-v2
--path serverless/openvino/omz/public/yolo-v3-tf/nuclio
--volume pwd/serverless/common:/opt/nuclio/common
--platform local

##############################################################

i'm accessing cvat using the url "https://www.xx.com" which directs traffic to an ALB which inturn forwards traffic to ec2 instance private ip.
ALB has SSL certificate attached for my dns "xx.com"

@azhavoro
Copy link
Contributor

Your ALB (or reverse proxy) must set X-Forwarded-Proto to https.

@922tech
Copy link

922tech commented Oct 8, 2024

I get the exact same error
Just try to create a task with a 5MB image or bigger
After 100% upload fails

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need info Need more information to investigate the issue
Projects
None yet
Development

No branches or pull requests

4 participants