# Internal Server Error 500 when running curl from batch file, but not when running directly on command line

**URL:** <https://discuss.elastic.co/t/internal-server-error-500-when-running-curl-from-batch-file-but-not-when-running-directly-on-command-line/170786>\
**Category:** Elasticsearch\
**Created:** [March 4, 2019, 8:00pm UTC](https://discuss.elastic.co/t/internal-server-error-500-when-running-curl-from-batch-file-but-not-when-running-directly-on-command-line/170786 "2019-03-04T20:00:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Isaac\_Buckman](https://avatars.discourse-cdn.com/v4/letter/i/45deac/32.png) [@Isaac\_Buckman](https://discuss.elastic.co/u/Isaac_Buckman)\
**Post date:** [March 4, 2019, 8:00pm UTC](https://discuss.elastic.co/t/internal-server-error-500-when-running-curl-from-batch-file-but-not-when-running-directly-on-command-line/170786/1 "2019-03-04T20:00:04Z")

</div>

Hi,

I'm trying to make a (windows) batch file to run reports automatically. When I enter the curl command by hand, it works fine, returning the response with the "path" to the report that I expect. When I copy and paste the same exact command and run it from a batch file, I get an "Internal Server Error 500" message instead of the proper response.

I'm not sure I understand how running the exact same curl command from a batch file would be any different from running it directly on the command line? Has anyone seen something like that before?

Here's the response from "GET /":  
{  
"name": "prod-elasticsearch-2",  
"cluster\_name": "elasticsearch-prod",  
"cluster\_uuid": "LUQZIUonS7m7kHfwVuRqYg",  
"version": {  
"number": "6.2.4",  
"build\_hash": "ccec39f",  
"build\_date": "2018-04-12T20:37:28.497551Z",  
"build\_snapshot": false,  
"lucene\_version": "7.2.1",  
"minimum\_wire\_compatibility\_version": "5.6.0",  
"minimum\_index\_compatibility\_version": "5.0.0"  
},  
"tagline": "You Know, for Search"  
}

Thanks.

---

<div class="post-metadata">

**Author:** ![Isaac\_Buckman](https://avatars.discourse-cdn.com/v4/letter/i/45deac/32.png) [@Isaac\_Buckman](https://discuss.elastic.co/u/Isaac_Buckman)\
**Post date:** [March 4, 2019, 8:04pm UTC](https://discuss.elastic.co/t/internal-server-error-500-when-running-curl-from-batch-file-but-not-when-running-directly-on-command-line/170786/2 "2019-03-04T20:04:15Z")

</div>

You know what, I just realized it might be all the %'s in the URL, lemme try escaping them

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 1, 2019, 8:04pm UTC](https://discuss.elastic.co/t/internal-server-error-500-when-running-curl-from-batch-file-but-not-when-running-directly-on-command-line/170786/3 "2019-04-01T20:04:15Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
