question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

@azure/storage-blob@>12.2.0 throws `Bad Request - Invalid Verb` on upload

See original GitHub issue

Similar to #11163.

I have script running every 5 minutes for all of eternity that uploads to blob storage, starting ~a day ago I started getting consistent Bad Request - Invalid Verb errors from this code:

	const blobServiceClient = BlobServiceClient.fromConnectionString(key)
	const containerClient = blobServiceClient.getContainerClient(container)

	const createContainerResponse = containerClient.getBlockBlobClient(name)

	await createContainerResponse.uploadStream(Readable.from([text]))

This is consistent with the release of 12.2.0, which I see made some changes to the uploadStream method.

The exact response is as follows:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>Bad Request</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
<BODY><h2>Bad Request - Invalid Verb</h2>
<hr><p>HTTP Error 400. The request verb is invalid.</p>
</BODY></HTML> 

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:5
  • Comments:34 (23 by maintainers)

github_iconTop GitHub Comments

2reactions
ljian3377commented, Sep 18, 2020

We belive this issue is addressed in the hotfix: @azure/storage-blob@12.2.1 and @azure/storage-file-datalake@12.1.1 Let me know if not.

2reactions
ljian3377commented, Sep 16, 2020

any workaround we can apply to avoid this temporarily ?

A fix is coming soon. Before that, could you call uploadFile for file, or stageBlock and commitBlockList individually.

      const body = () => yourStream;
      await blockBlobClient.stageBlock(base64encode("1"), body, body.length);
      await blockBlobClient.stageBlock(base64encode("2"), body2, body2.length);
      await blockBlobClient.commitBlockList([base64encode("1"), base64encode("2")]);

Also, disabling keep-alive will also work.

    const pipeline = newPipeline(credential, {
      keepAliveOptions: {
        enable: false
      }
    });

    const blobPrimaryURL = `https://${credential.accountName}${accountNameSuffix}.blob.core.windows.net/`;
    return new BlobServiceClient(blobPrimaryURL, pipeline);
Read more comments on GitHub >

github_iconTop Results From Across the Web

All browsers & all sites I get errors: Invalid Verb - Requst
The request verb is invalid. Same sites errors according to IE (11.0.9600.17801): Site 1. Error 400 (Bad request) [Title]
Read more >
Intermittent 400 "Invalid Verb" er… | Apple Developer Forums
I have an Enterprise iOS app that allows users to upload images to our Sharepoint Intranet. The app simply does a PUT request...
Read more >
How to Fix a 400 Bad Request Error (Causes and Fixes) - Kinsta
The 400 Bad Request error indicates that the server cannot or process the request due to a client error. Read about the common...
Read more >
Cannot upload to azure Blob Storage: The remote server ...
If you request a container with an invalid name, it will result in (400) Bad Request, which you are getting. So check your...
Read more >
Getting Bad Request (Invalid Verb) when uploading a page ...
When I specify a file to upload and submit the form I'm given a Bad Request (Invalid Verb) HTTP Error 400 page instead...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found