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

azurite connection refused error #1194

Closed
swimhiking opened this issue Nov 26, 2021 · 9 comments
Closed

azurite connection refused error #1194

swimhiking opened this issue Nov 26, 2021 · 9 comments
Assignees
Labels
blob-storage question Further information is requested

Comments

@swimhiking
Copy link

Which service(blob, file, queue, table) does this issue concern?

I am using only blob service

Which version of the Azurite was used?

3.13.1 and 3.14.3

Where do you get Azurite? (npm, DockerHub, NuGet, Visual Studio Code Extension)

npm

What's the Node.js version?

16.13.0

What problem was encountered?

(failed)net::ERR_CONNECTION_REFUSED

Steps to reproduce the issue?

I have a simple react with ant design upload component, when try to upload some files, got connection refused error.

in azurite container, I also set CORS to *; access policy set to GET, PUT, POST, DELETE;

I use the default connection string;

If possible, please provide the debug log using the -d parameter, replacing <pathtodebuglog> with an appropriate path for your OS, or review the instructions for docker containers:
didn't use docker, directly run in windows 10;
debug info from log file:
2021-11-26T17:57:45.404Z info: AccountDataStore:init() Fallback to default emulator account devstoreaccount1.
2021-11-26T17:57:45.465Z info: QueueGCManager:markSweepLoop() Start new mark and sweep.
2021-11-26T17:57:45.466Z info: QueueGCManger:markSweep() Get all extents.
2021-11-26T17:57:45.466Z info: QueueGCManager:marksweep() Get 0 extents.
2021-11-26T17:57:45.466Z info: QueueGCManager:markSweep() Get referred extents, then remove from allExtents.
2021-11-26T17:57:45.466Z info: QueueGCManager:markSweep() Got referred extents, unreferenced extents count is 0.
2021-11-26T17:57:45.466Z info: QueueGCManager:markSweepLoop() Mark and sweep finished, take 0ms.
2021-11-26T17:57:45.466Z info: QueueGCManager:markSweepLoop() Sleep for 60000
2021-11-26T17:57:45.467Z info: AccountDataStore:init() Refresh accounts from environment variable AZURITE_ACCOUNTS with value undefined
2021-11-26T17:57:45.467Z info: AccountDataStore:init() Fallback to default emulator account devstoreaccount1.

-d "<pathtodebuglog>"

Please be sure to remove any PII or sensitive information before sharing!
The debug log will log raw request headers and bodies, so that we can replay these against Azurite using REST and create tests to validate resolution.

Have you found a mitigation/solution?

currently create a blob in azure account, and it works.

@blueww
Copy link
Member

blueww commented Nov 29, 2021

@swimhiking
From the debug log, I don't see Azurite receive any request from client.
And normally, debug log should have log like following when Azurite start.
"info Azurite Blob service is starting on 127.0.0.1:10000"
"info Azurite Blob service successfully listens on http://127.0.0.1:10000"
Not sure if you see them in the Azurite start debug log?

Besides that, for the default connection string, do you mean "DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;QueueEndpoint=http://127.0.0.1:10001/devstoreaccount1;TableEndpoint=http://127.0.0.1:10002/devstoreaccount1;"?

@blueww blueww added blob-storage question Further information is requested labels Nov 29, 2021
@blueww blueww self-assigned this Nov 29, 2021
@swimhiking
Copy link
Author

thanks for the quick reply; you are right, not sure my log has some issue, I use this command to get this log file: azurite --debug c:\azurite\debug.log; the command window has Azurite start information like above your example;

for the default connection string, similar as above since I only use blob, also I specify container name using a second variable: "DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1/;"

Thanks for your help

@swimhiking
Copy link
Author

@blueww
I found I can upload file to azurite by setting -L in command line; but networking got 500, Referrer Policy: strict-origin-when-cross-origin although I set CORS to *. attached image has more detail information. thanks
UseAzurite

@blueww
Copy link
Member

blueww commented Nov 30, 2021

@swimhiking

Do you see any request log in the Azurite debug log?
If so, would you please share the debug log.
If not, it looks the request still not send to Azurite. Please check the connection to Azurite, and the port is available on your machine.
Besides that, if a request is refused since CORS setting with Azurite, the error code should not be 500. So there should be other reason for the 500 error.

@swimhiking
Copy link
Author

swimhiking commented Nov 30, 2021

@blueww
you are right, I feel weird when got the 500 error; If I switch to actual Azure blob account, there's no issues; I attached some screen and a full log from azurite, not sure what could be the issue; by the way, this 500 error actually from save same attribute values to CosmosDB, the file upload to azurite is success as below screen. thanks.

image
debug.log

@blueww
Copy link
Member

blueww commented Dec 1, 2021

@swimhiking
I see some 400 errors in the Azurite debug log, they're caused by the Uri in following format can't be recognize by Azurite.
RequestMethod=GET RequestURL=http://127.0.0.1/devstoreaccount1?comp=blobs&where=entityId%3D%270d050340-5201-11ec-a03d-1fe024a70efb%27%20and%20entityType%3D%27WaterActivity%27%20and%20attachmentField%3D%27relevantFiles%27

From the Uri, it looks like filter blob with blob tag request: https://docs.microsoft.com/en-us/rest/api/storageservices/find-blobs-by-tags?
Blob Tag is still not supported in Azurite. This is already mentioned in https://github.com/Azure/Azurite#support-matrix, and we already have issue to track it: #647

@swimhiking
Copy link
Author

right, this is the reason; thanks for your help.

@blueww
Copy link
Member

blueww commented Dec 2, 2021

@swimhiking
I would like to close this issue as we already has an issue to track Blob tag support #647.
Do you have any concern?

@swimhiking
Copy link
Author

yes, we can close this; thanks

@blueww blueww closed this as completed Dec 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blob-storage question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants