# 401 Unauthorized on 3rd and beyond request using Runner to iterate through CSV

**URL:** <https://community.postman.com/t/401-unauthorized-on-3rd-and-beyond-request-using-runner-to-iterate-through-csv/718>\
**Category:** Help Hub\
**Created:** [January 19, 2018, 3:07pm UTC](https://community.postman.com/t/401-unauthorized-on-3rd-and-beyond-request-using-runner-to-iterate-through-csv/718 "2018-01-19T15:07:10Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![rustoleum76](https://avatars.discourse-cdn.com/v4/letter/r/aeb1de/32.png) [@rustoleum76](https://community.postman.com/u/rustoleum76)\
**Post date:** [January 19, 2018, 3:07pm UTC](https://community.postman.com/t/401-unauthorized-on-3rd-and-beyond-request-using-runner-to-iterate-through-csv/718/1 "2018-01-19T15:07:10Z")

</div>

I receive a “401 Unauthorized” error on the 3rd, 4th, 5th, etc request when using the Runner to iterate through a CSV file.

The first two requests are just fine, the 3rd and beyond fail.

 ![UnauthorizedRunner](https://us1.discourse-cdn.com/getpostman/original/3X/5/e/5e3dbe7dbcc6e1585418f6a931c88c8bd0883bc0.jpeg)

Interestingly, I’ve found that if I run 2 iterations, then 3 iterations, then the whole set, I can get through a successful run.

This has been manageable for now to get a set of tests written and tested, but now I’m looking to execute this set via command line using newman as part of our daily build process and the error continues, and it’s not obvious how to implement the same work around via command line.

What’s going on here? Thanks for any assistance!

---

<div class="post-metadata">

**Author:** ![rustoleum76](https://avatars.discourse-cdn.com/v4/letter/r/aeb1de/32.png) [@rustoleum76](https://community.postman.com/u/rustoleum76)\
**Post date:** [January 19, 2018, 3:08pm UTC](https://community.postman.com/t/401-unauthorized-on-3rd-and-beyond-request-using-runner-to-iterate-through-csv/718/2 "2018-01-19T15:08:24Z")

</div>

Here is a screen cap of a successful run when using the Run 2 iterations, then Run 3 iterations, then Run the whole set work around. NTLM settings are unchanged from the 401 execution, the script is identical, etc:

 ![Authorized](https://us1.discourse-cdn.com/getpostman/original/3X/6/6/66ff953943268c3c4f0f8320416a69fb84a904dc.jpeg)

---

<div class="post-metadata">

**Author:** ![abhijitkane1](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/abhijitkane1/32/4_2.png) [@abhijitkane1](https://community.postman.com/u/abhijitkane1)\
**Post date:** [January 24, 2018, 9:40am UTC](https://community.postman.com/t/401-unauthorized-on-3rd-and-beyond-request-using-runner-to-iterate-through-csv/718/3 "2018-01-24T09:40:17Z")

</div>

@rustoleum76 There might be some sort of rate limiting at play. Can you try adding a delay of “2000” in the runner UI? (This will add a delay of 2 seconds between each request)

---

<div class="post-metadata">

**Author:** ![rustoleum76](https://avatars.discourse-cdn.com/v4/letter/r/aeb1de/32.png) [@rustoleum76](https://community.postman.com/u/rustoleum76)\
**Post date:** [February 2, 2018, 2:43pm UTC](https://community.postman.com/t/401-unauthorized-on-3rd-and-beyond-request-using-runner-to-iterate-through-csv/718/4 "2018-02-02T14:43:53Z")

</div>

Hi @abhijitkane1,  
thanks for your reply.

The 2000ms delay doesn’t change anything unfortunately.

I’ve learned more about Postman and JS and have dug deeper.

The problem seems related to a JSON.parse(responseBody) call in “Tests”

Object:{}  
message:"Unexpected token ‘\<’ at 1:1 \<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” "[http://www.w3.org/TR/](http://www.w3.org/TR/) ^"  
name:"JSONError"  
type:“Error”

---

<div class="post-metadata">

**Author:** ![rustoleum76](https://avatars.discourse-cdn.com/v4/letter/r/aeb1de/32.png) [@rustoleum76](https://community.postman.com/u/rustoleum76)\
**Post date:** [February 7, 2018, 10:42pm UTC](https://community.postman.com/t/401-unauthorized-on-3rd-and-beyond-request-using-runner-to-iterate-through-csv/718/5 "2018-02-07T22:42:32Z")

</div>

learning more… the above error is a red herring. The json parse problem comes because an invalid response was received due to the previously determined 401 Unauthorized.

The Response:

> 401 - Unauthorized: Access is denied due to invalid credentials. 
> 
> # Server Error
> 
> ## 401 - Unauthorized: Access is denied due to invalid credentials.
> 
> ### You do not have permission to view this directory or page using the credentials that you supplied.

And looking at the server that I’m calling to, I can see the requests and response code:

> 2018-02-07 22:27:37 IP\_redacted POST /AnalyticsServices/AccruedInterest/CalcAccruedInterest - 443 - IP2\_redacted PostmanRuntime/7.1.1 - 401 2 5 0  
> 2018-02-07 22:27:37 IP\_redacted POST /AnalyticsServices/AccruedInterest/CalcAccruedInterest - 443 DOMAIN\User IP2\_redacted PostmanRuntime/7.1.1 - 200 0 0 42  
> 2018-02-07 22:27:37 IP\_redacted POST /AnalyticsServices/AccruedInterest/CalcAccruedInterest - 443 DOMAIN\User IP2\_redacted PostmanRuntime/7.1.1 - 200 0 0 26  
> 2018-02-07 22:27:37 IP\_redacted POST /AnalyticsServices/AccruedInterest/CalcAccruedInterest - 443 - IP2\_redacted PostmanRuntime/7.1.1 - 401 1 2148074248 0  
> 2018-02-07 22:27:37 IP\_redacted POST /AnalyticsServices/AccruedInterest/CalcAccruedInterest - 443 - IP2\_redacted PostmanRuntime/7.1.1 - 401 1 2148074248 0  
> 2018-02-07 22:27:37 IP\_redacted POST /AnalyticsServices/AccruedInterest/CalcAccruedInterest - 443 - IP2\_redacted PostmanRuntime/7.1.1 - 401 1 2148074248 0

The first two succeed with status 200 (and also w/ credentials being passed). Subsequent requests return 401 and I can see no credentials being passed.

So, it seems like the Runner process is not sending the NTLM credentials correctly at each iteration, except when I do the weird workaround where I run 2, then run 3 and then run the test.

Incidentally, when I do that, I can see each succeeding request does indeed have user details specified:

> 2018-02-07 22:10:12 IP\_redacted POST /AnalyticsServices/AccruedInterest/CalcAccruedInterest - 443 - IP2\_redacted PostmanRuntime/7.1.1 - 401 2 5 0  
> 2018-02-07 22:10:12 IP\_redacted POST /AnalyticsServices/AccruedInterest/CalcAccruedInterest - 443 DOMAIN\USER IP2\_redacted PostmanRuntime/7.1.1 - 200 0 0 46  
> 2018-02-07 22:10:12 IP\_redacted POST /AnalyticsServices/AccruedInterest/CalcAccruedInterest - 443 DOMAIN\USER IP2\_redacted PostmanRuntime/7.1.1 - 200 0 0 31  
> 2018-02-07 22:10:20 IP\_redacted POST /AnalyticsServices/AccruedInterest/CalcAccruedInterest - 443 DOMAIN\USER IP2\_redacted PostmanRuntime/7.1.1 - 200 0 0 15  
> 2018-02-07 22:10:20 IP\_redacted POST /AnalyticsServices/AccruedInterest/CalcAccruedInterest - 443 DOMAIN\USER IP2\_redacted PostmanRuntime/7.1.1 - 200 0 0 13  
> 2018-02-07 22:10:20 IP\_redacted POST /AnalyticsServices/AccruedInterest/CalcAccruedInterest - 443 DOMAIN\USER IP2\_redacted PostmanRuntime/7.1.1 - 200 0 0 31  
> 2018-02-07 22:10:28 IP\_redacted POST /AnalyticsServices/AccruedInterest/CalcAccruedInterest - 443 DOMAIN\USER IP2\_redacted PostmanRuntime/7.1.1 - 200 0 0 19  
> 2018-02-07 22:10:28 IP\_redacted POST /AnalyticsServices/AccruedInterest/CalcAccruedInterest - 443 DOMAIN\USER IP2\_redacted PostmanRuntime/7.1.1 - 200 0 0 31  
> 2018-02-07 22:10:28 IP\_redacted POST /AnalyticsServices/AccruedInterest/CalcAccruedInterest - 443 DOMAIN\USER IP2\_redacted PostmanRuntime/7.1.1 - 200 0 0 31

---

<div class="post-metadata">

**Author:** ![Amar.Pottumuthu](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@Amar.Pottumuthu](https://community.postman.com/u/Amar.Pottumuthu)\
**Post date:** [May 17, 2018, 10:47pm UTC](https://community.postman.com/t/401-unauthorized-on-3rd-and-beyond-request-using-runner-to-iterate-through-csv/718/6 "2018-05-17T22:47:16Z")

</div>

Hi @abhijitkane1, i have the same issue. The first 2 tests are passing and the remaining I am getting the error “Unauthorized: Access is denied due to invalid credentials”

---

<div class="post-metadata">

**Author:** ![ashu12318](https://avatars.discourse-cdn.com/v4/letter/a/b38774/32.png) [@ashu12318](https://community.postman.com/u/ashu12318)\
**Post date:** [September 18, 2018, 6:25am UTC](https://community.postman.com/t/401-unauthorized-on-3rd-and-beyond-request-using-runner-to-iterate-through-csv/718/7 "2018-09-18T06:25:30Z")

</div>

Hello folks,

Any update on this?  
Did you find any solution or exact issue for that?

Thanks,  
Ashutosh Singh

---

<div class="post-metadata">

**Author:** ![tkloeber](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/tkloeber/32/8884_2.png) [@tkloeber](https://community.postman.com/u/tkloeber)\
**Post date:** [September 19, 2018, 7:12am UTC](https://community.postman.com/t/401-unauthorized-on-3rd-and-beyond-request-using-runner-to-iterate-through-csv/718/8 "2018-09-19T07:12:18Z")

</div>

It’s hard to tell without knowing more about your test scripts.  
If you check the HTTP response code before trying to parse your response body you certainly can avoid the JSON error (it’s not really a red herring after all ;)).

If you log some information in your tests you probably can see what’s going on with your iterations and where/why it starts to fail.

---

<div class="post-metadata">

**Author:** ![ashu12318](https://avatars.discourse-cdn.com/v4/letter/a/b38774/32.png) [@ashu12318](https://community.postman.com/u/ashu12318)\
**Post date:** [September 22, 2018, 3:17pm UTC](https://community.postman.com/t/401-unauthorized-on-3rd-and-beyond-request-using-runner-to-iterate-through-csv/718/9 "2018-09-22T15:17:07Z")

</div>

In my script I am doing nothing except making calls to same service 10 times using runner.  
I am not processing any response.

But the solution suggested above by running runner first for 1 iteration, then for 2 and then for as many as you want it doesnt fail.

---

<div class="post-metadata">

**Author:** ![tkloeber](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/tkloeber/32/8884_2.png) [@tkloeber](https://community.postman.com/u/tkloeber)\
**Post date:** [September 24, 2018, 6:14am UTC](https://community.postman.com/t/401-unauthorized-on-3rd-and-beyond-request-using-runner-to-iterate-through-csv/718/10 "2018-09-24T06:14:45Z")

</div>

this sounds more like an issue with your service.

---

<div class="post-metadata">

**Author:** ![AiboliD](https://avatars.discourse-cdn.com/v4/letter/a/e9bcb4/32.png) [@AiboliD](https://community.postman.com/u/AiboliD)\
**Post date:** [April 23, 2020, 12:09pm UTC](https://community.postman.com/t/401-unauthorized-on-3rd-and-beyond-request-using-runner-to-iterate-through-csv/718/11 "2020-04-23T12:09:54Z")

</div>

Dear POSTMAN team. Please responce on this topic. This problem is alive since 2018 till NOW (04.2020). Thanks this issue you men lose your money simply why firms dont want purchase PRO version cause the COLLECTION RUNNER simply can not be applied for couple of real projects.

---

<div class="post-metadata">

**Author:** ![kiranreddygangula](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/kiranreddygangula/32/5728_2.png) [@kiranreddygangula](https://community.postman.com/u/kiranreddygangula)\
**Post date:** [September 28, 2020, 4:46pm UTC](https://community.postman.com/t/401-unauthorized-on-3rd-and-beyond-request-using-runner-to-iterate-through-csv/718/12 "2020-09-28T16:46:35Z")

</div>

I have the same issue. For the first 2 iterations, there is no issue. The subsequent iterations giving the Unauthorization error. I am using NTLM authentication and I pass Username and Password. For the first 2 iterations, the NTLM auth key is unique , but on the next iterations, the auth key is similar to the 2nd iteration. i.e. somehow postman is keeping the auth key in memory and applying the same from 3rd iteration on words rather generation new key.

---

<div class="post-metadata">

**Author:** ![lozanodev](https://avatars.discourse-cdn.com/v4/letter/l/b782af/32.png) [@lozanodev](https://community.postman.com/u/lozanodev)\
**Post date:** [July 29, 2022, 6:57pm UTC](https://community.postman.com/t/401-unauthorized-on-3rd-and-beyond-request-using-runner-to-iterate-through-csv/718/13 "2022-07-29T18:57:05Z")

</div>

Hello,  
I’d like to verify that this is still an issue in the most recent version of Postman. I have a collection of services that use Windows authentication and if I select any set of 3 or more, the first two will execute properly, returning 200’s, and the rest will 401. Setting delays between the service calls of up to 5000 ms has no positive effect.

Has there been a solution or workaround identified for this?

---

<div class="post-metadata">

**Author:** ![martynlesbirel-tsg](https://avatars.discourse-cdn.com/v4/letter/m/6bbea6/32.png) [@martynlesbirel-tsg](https://community.postman.com/u/martynlesbirel-tsg)\
**Post date:** [May 25, 2023, 9:57am UTC](https://community.postman.com/t/401-unauthorized-on-3rd-and-beyond-request-using-runner-to-iterate-through-csv/718/14 "2023-05-25T09:57:07Z")

</div>

Hello,

And once more using Postman 10.14.5 currently the latest and still experiencing the same problems as described above.

---

<div class="post-metadata">

**Author:** ![saridonix](https://avatars.discourse-cdn.com/v4/letter/s/779978/32.png) [@saridonix](https://community.postman.com/u/saridonix)\
**Post date:** [April 24, 2024, 9:40am UTC](https://community.postman.com/t/401-unauthorized-on-3rd-and-beyond-request-using-runner-to-iterate-through-csv/718/15 "2024-04-24T09:40:55Z")

</div>

Hey guys! I encountered the same error. I use NTLM authentification. I checked “Yes, disable retrying the request” in the “Authorization” tab, saved, ran the collection then disabled the option again, saved and ran the collection. It fixed the issue.
