# Cannot upload source maps

**URL:** <https://discuss.elastic.co/t/cannot-upload-source-maps/163478>\
**Category:** APM\
**Created:** [January 9, 2019, 8:45am UTC](https://discuss.elastic.co/t/cannot-upload-source-maps/163478 "2019-01-09T08:45:30Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gegenki](https://avatars.discourse-cdn.com/v4/letter/g/e36b37/32.png) [@Gegenki](https://discuss.elastic.co/u/Gegenki)\
**Post date:** [January 9, 2019, 8:45am UTC](https://discuss.elastic.co/t/cannot-upload-source-maps/163478/1 "2019-01-09T08:45:30Z")

</div>

I am trying to enable client side error logging using RUM.

I have used these pages to guide me  
[https://www.elastic.co/guide/en/apm/agent/js-base/current/sourcemap.html](https://www.elastic.co/guide/en/apm/agent/js-base/current/sourcemap.html)  
[https://www.elastic.co/guide/en/apm/server/current/sourcemaps.html](https://www.elastic.co/guide/en/apm/server/current/sourcemaps.html)

I've tried it both in Postman and Javascript and I always get the following response:

{  
"error": "Content-Type header [multipart/form-data; boundary=--------------------------037463214125015102208974] is not supported",  
"status": 406  
}

The boundary number changes on each request.  
What is going on here?

Elasticsearch version is 6.5.4

---

<div class="post-metadata">

**Author:** ![jalvz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jalvz/32/45613_2.png) [@jalvz](https://discuss.elastic.co/u/jalvz)\
**Post date:** [January 9, 2019, 11:05am UTC](https://discuss.elastic.co/t/cannot-upload-source-maps/163478/2 "2019-01-09T11:05:17Z")

</div>

Hello!

That sounds like the multipart/form-data is not correct; I don't know how Postman sends the request behind the scenes, but with `curl` you can do it like so:

`curl -v -X POST http://127.0.0.1:8200/assets/v1/sourcemaps -F service_name="test-service" -F service_version="1.0" -F bundle_filepath="http://localhost/static/js/bundle.js" -F sourcemap=@bundle.js.map`

Do you get the same error if you try it like that?

Juan

---

<div class="post-metadata">

**Author:** ![Gegenki](https://avatars.discourse-cdn.com/v4/letter/g/e36b37/32.png) [@Gegenki](https://discuss.elastic.co/u/Gegenki)\
**Post date:** [January 9, 2019, 11:48am UTC](https://discuss.elastic.co/t/cannot-upload-source-maps/163478/3 "2019-01-09T11:48:22Z")

</div>

Yes it is the same; Here is the output

> Jordans-MacBook-Pro:example jordan$ ls  
> bundle.js.map  
> Jordans-MacBook-Pro:example jordan$ curl -v -X POST https://[redacted].eu-west-1.aws.found.io:9243/assets/v1/sourcemaps -F service\_name="test-service" -F service\_version="1.0" -F bundle\_filepath="[http://localhost/static/js/bundle.js](http://localhost/static/js/bundle.js)" -F sourcemap=@bundle.js.map  
> Note: Unnecessary use of -X or --request, POST is already inferred.  
> \* Trying [redacted]...  
> \* TCP\_NODELAY set  
> \* Connected to [redacted].eu-west-1.aws.found.io ([redacted]) port 9243 (#0)  
> \* ALPN, offering http/1.1  
> \* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH  
> \* successfully set certificate verify locations:  
> \* CAfile: /Users/jordan/anaconda/ssl/cacert.pem  
> CApath: none  
> \* TLSv1.2 (OUT), TLS header, Certificate Status (22):  
> \* TLSv1.2 (OUT), TLS handshake, Client hello (1):  
> \* TLSv1.2 (IN), TLS handshake, Server hello (2):  
> \* TLSv1.2 (IN), TLS handshake, Certificate (11):  
> \* TLSv1.2 (IN), TLS handshake, Server key exchange (12):  
> \* TLSv1.2 (IN), TLS handshake, Server finished (14):  
> \* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):  
> \* TLSv1.2 (OUT), TLS change cipher, Client hello (1):  
> \* TLSv1.2 (OUT), TLS handshake, Finished (20):  
> \* TLSv1.2 (IN), TLS change cipher, Client hello (1):  
> \* TLSv1.2 (IN), TLS handshake, Finished (20):  
> \* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256  
> \* ALPN, server did not agree to a protocol  
> \* Server certificate:  
> \* subject: CN=_.eu-west-1.aws.found.io  
> \* start date: Jun 4 00:00:00 2018 GMT  
> \* expire date: Jul 4 12:00:00 2019 GMT  
> \* subjectAltName: host "[redacted].eu-west-1.aws.found.io" matched cert's "_.eu-west-1.aws.found.io"  
> \* issuer: C=US; O=Amazon; OU=Server CA 1B; CN=Amazon  
> \* SSL certificate verify ok.  
> POST /assets/v1/sourcemaps HTTP/1.1  
> Host: [redacted].eu-west-1.aws.found.io:9243  
> User-Agent: curl/7.52.1  
> Accept: _/_  
> Content-Length: 2549222  
> Expect: 100-continue  
> Content-Type: multipart/form-data; boundary=------------------------390df24a65c17fdd
> 
> \< HTTP/1.1 100 Continue  
> \< HTTP/1.1 406 Not Acceptable  
> \< Content-Type: application/json; charset=UTF-8  
> \< Date: Wed, 09 Jan 2019 11:42:55 GMT  
> \< Server: fp/4b1cb7  
> \< X-Found-Handling-Cluster: [redacted]  
> \< X-Found-Handling-Instance: instance-0000000004  
> \< X-Found-Handling-Server: 172.27.38.46  
> \< Content-Length: 134  
> \< Connection: keep-alive  
> \* HTTP error before end of send, stop sending  
> \<  
> \* Curl\_http\_done: called premature == 0  
> \* Closing connection 0  
> \* TLSv1.2 (OUT), TLS alert, Client hello (1):  
> {"error":"Content-Type header [multipart/form-data; boundary=------------------------390df24a65c17fdd] is not supported","status":406}

---

<div class="post-metadata">

**Author:** ![jalvz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jalvz/32/45613_2.png) [@jalvz](https://discuss.elastic.co/u/jalvz)\
**Post date:** [January 9, 2019, 12:57pm UTC](https://discuss.elastic.co/t/cannot-upload-source-maps/163478/4 "2019-01-09T12:57:40Z")

</div>

Hi,

I unfortunately can't reproduce it. Just to double check, you are also using Apm Server 6.5 and not setting the content type header at any moment, right? And you are POSTing that to the APM Server directly and not to any proxy.

Could be the case that the sourcemap is not correctly generated? If you wget this one [https://github.com/elastic/apm-server/blob/master/testdata/sourcemap/bundle.js.map](https://github.com/elastic/apm-server/blob/master/testdata/sourcemap/bundle.js.map) and POST it in the same way, does it work?

---

<div class="post-metadata">

**Author:** ![Gegenki](https://avatars.discourse-cdn.com/v4/letter/g/e36b37/32.png) [@Gegenki](https://discuss.elastic.co/u/Gegenki)\
**Post date:** [January 9, 2019, 5:00pm UTC](https://discuss.elastic.co/t/cannot-upload-source-maps/163478/5 "2019-01-09T17:00:52Z")

</div>

Thanks, your last comment about APM Server made me think about what I did - problem is solved.  
I was sending the request to elastic search instead of the apm 😕  
The same request to elastic search will attempt to create an index

---

<div class="post-metadata">

**Author:** ![jalvz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jalvz/32/45613_2.png) [@jalvz](https://discuss.elastic.co/u/jalvz)\
**Post date:** [January 10, 2019, 8:23am UTC](https://discuss.elastic.co/t/cannot-upload-source-maps/163478/6 "2019-01-10T08:23:30Z")

</div>

Glad to hear you got it, have a good day.

Juan

---

<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:** [February 7, 2019, 8:23am UTC](https://discuss.elastic.co/t/cannot-upload-source-maps/163478/7 "2019-02-07T08:23:43Z")

</div>

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