cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Hana WebIDE: Error: Unsupported content type: multipart/mixed;boundary=batch

draschke
Active Contributor
0 Kudos

Hi,

we tried to move our SAPUI5 Master-Detail App to xs advanced.

We are on SPS11, Rev. 112

If we try to start the app, we get this ODATA problem:

Error: Unsupported content type: multipart/mixed;boundary=batch

Failed to load resource: the server responded with a status of 500 (Internal Server Error)

Any help would be great.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

I've also hit the same issue when testing the an App, however I got some useful tips from Thomas Jung which worked for me.


Try deploying the application similar to the steps in '2.1.4 Deploy the "Tiny World" Application'  in the  XSA Dev guide.


It's a bit painful, but might get you past this issue.

draschke
Active Contributor
0 Kudos

Hi Aron,

good to know, thanks for this hint!

Today we try to patch our XSA on the current version (June'16). Afterwards I'll check for it on the regulary way.

But if this doesn't work I'll try your proposal.

BR

Dirk

I found out that with the new patch for SPS12 only the runtime version (v1.0.28) has changed, but I think this will not solve this problem.

That's why I'll try your way first and give feedback if it worked for us.

draschke
Active Contributor
0 Kudos

So, now the same issue with SPS12.

I would like to know, could this (Unsupported content type) error caused, because we have  an XSRF-Token error before?

Application is starting

Application is running

6/3/16 2:11:25.000 PM [APP/24714-0] TRC    /node_modules/approuter/lib/middleware/xsrf-token-middleware.js:14 [iozt72vz] ERROR: Failed to get new xsrf token [Error: No session established. Failed to store token in session]

6/3/16 2:11:25.156 PM [APP/24714-0] LOG   #2.0#2016 06 03 16:11:25:156#+02:00#ERROR#/XSRF-Handler###############iozt72vz#PLAIN##Failed to get new xsrf token [Error: No session established. Failed to store token in session]#

6/3/16 2:11:25.210 PM [APP/24714-0] ERR    Error: Unsupported content type: multipart/mixed;boundary=batch_a5a7-be1b-8fb7

6/3/16 2:11:25.210 PM [APP/24714-0] ERR        at Busboy.parseHeaders (/HANA/usr_sap/DUMMYHOST/xs/ea_data/DUMMYHOST/executionroot/f70e308a-b047-4752-b058-dbb75c18ac76/app/appcontroller.TrmOttoSxE/AppController/node_modules/multer/node_modules/busboy/lib/main.js:68:9)

6/3/16 2:11:25.210 PM [APP/24714-0] ERR        at new Busboy (/HANA/usr_sap/DUMMYHOST/xs/ea_data/DUMMYHOST/executionroot/f70e308a-b047-4752-b058-dbb75c18ac76/app/appcontroller.TrmOttoSxE/AppController/node_modules/multer/node_modules/busboy/lib/main.js:21:10)

6/3/16 2:11:25.210 PM [APP/24714-0] ERR        at multerMiddleware (/HANA/usr_sap/DUMMYHOST/xs/ea_data/DUMMYHOST/executionroot/f70e308a-b047-4752-b058-dbb75c18ac76/app/appcontroller.TrmOttoSxE/AppController/node_modules/multer/lib/make-middleware.js:32:16)

6/3/16 2:11:25.210 PM [APP/24714-0] ERR        at Layer.handle [as handle_request] (/HANA/usr_sap/DUMMYHOST/xs/ea_data/DUMMYHOST/executionroot/f70e308a-b047-4752-b058-dbb75c18ac76/app/appcontroller.TrmOttoSxE/AppController/node_modules/express/lib/router/layer.js:95:5)

6/3/16 2:11:25.210 PM [APP/24714-0] ERR        at trim_prefix (/HANA/usr_sap/DUMMYHOST/xs/ea_data/DUMMYHOST/executionroot/f70e308a-b047-4752-b058-dbb75c18ac76/app/appcontroller.TrmOttoSxE/AppController/node_modules/express/lib/router/index.js:312:13)

6/3/16 2:11:25.211 PM [APP/24714-0] ERR        at /HANA/usr_sap/DUMMYHOST/xs/ea_data/DUMMYHOST/executionroot/f70e308a-b047-4752-b058-dbb75c18ac76/app/appcontroller.TrmOttoSxE/AppController/node_modules/express/lib/router/index.js:280:7

6/3/16 2:11:25.211 PM [APP/24714-0] ERR        at Function.process_params (/HANA/usr_sap/DUMMYHOST/xs/ea_data/DUMMYHOST/executionroot/f70e308a-b047-4752-b058-dbb75c18ac76/app/appcontroller.TrmOttoSxE/AppController/node_modules/express/lib/router/index.js:330:12)

6/3/16 2:11:25.211 PM [APP/24714-0] ERR        at next (/HANA/usr_sap/DUMMYHOST/xs/ea_data/DUMMYHOST/executionroot/f70e308a-b047-4752-b058-dbb75c18ac76/app/appcontroller.TrmOttoSxE/AppController/node_modules/express/lib/router/index.js:271:10)

6/3/16 2:11:25.211 PM [APP/24714-0] ERR        at /HANA/usr_sap/DUMMYHOST/xs/ea_data/DUMMYHOST/executionroot/f70e308a-b047-4752-b058-dbb75c18ac76/app/appcontroller.TrmOttoSxE/AppController/utils/fileStorage.js:43:13

6/3/16 2:11:25.211 PM [APP/24714-0] ERR        at Layer.handle [as handle_request] (/HANA/usr_sap/DUMMYHOST/xs/ea_data/DUMMYHOST/executionroot/f70e308a-b047-4752-b058-dbb75c18ac76/app/appcontroller.TrmOttoSxE/AppController/node_modules/express/lib/router/layer.js:95:5)

6/3/16 2:11:25.211 PM [APP/24714-0] ERR        at trim_prefix (/HANA/usr_sap/DUMMYHOST/xs/ea_data/DUMMYHOST/executionroot/f70e308a-b047-4752-b058-dbb75c18ac76/app/appcontroller.TrmOttoSxE/AppController/node_modules/express/lib/router/index.js:312:13)

6/3/16 2:11:25.211 PM [APP/24714-0] ERR        at /HANA/usr_sap/DUMMYHOST/xs/ea_data/DUMMYHOST/executionroot/f70e308a-b047-4752-b058-dbb75c18ac76/app/appcontroller.TrmOttoSxE/AppController/node_modules/express/lib/router/index.js:280:7

6/3/16 2:11:25.211 PM [APP/24714-0] ERR        at Function.process_params (/HANA/usr_sap/DUMMYHOST/xs/ea_data/DUMMYHOST/executionroot/f70e308a-b047-4752-b058-dbb75c18ac76/app/appcontroller.TrmOttoSxE/AppController/node_modules/express/lib/router/index.js:330:12)

6/3/16 2:11:25.211 PM [APP/24714-0] ERR        at next (/HANA/usr_sap/DUMMYHOST/xs/ea_data/DUMMYHOST/executionroot/f70e308a-b047-4752-b058-dbb75c18ac76/app/appcontroller.TrmOttoSxE/AppController/node_modules/express/lib/router/index.js:271:10)

6/3/16 2:11:25.211 PM [APP/24714-0] ERR        at logger (/HANA/usr_sap/DUMMYHOST/xs/ea_data/DUMMYHOST/executionroot/f70e308a-b047-4752-b058-dbb75c18ac76/app/appcontroller.TrmOttoSxE/AppController/node_modules/morgan/index.js:136:5)

6/3/16 2:11:25.211 PM [APP/24714-0] ERR        at Layer.handle [as handle_request] (/HANA/usr_sap/DUMMYHOST/xs/ea_data/DUMMYHOST/executionroot/f70e308a-b047-4752-b058-dbb75c18ac76/app/appcontroller.TrmOttoSxE/AppController/node_modules/express/lib/router/layer.js:95:5)

Application:https://DUMMYHOST:51031Logs

draschke
Active Contributor
0 Kudos

Hi,

me again. Now I get this error without any missing Token msg. It has nothing to do with it!

I would say, there must be still a bug within "sap-xsjs": "1.6.4".

Thanks!

christoph_pohl
Product and Topic Expert
Product and Topic Expert
0 Kudos

: Any thoughts?

0 Kudos

Hi,

Looking at the error in the log it seems to originate from AppController. I think this is the intermediate node.js process inserted by the DevX buildpack for hot-deployment.

do you recognise this?

Best regards,

Petar

draschke
Active Contributor
0 Kudos

Thanks Petar!

christoph_pohl
Product and Topic Expert
Product and Topic Expert
0 Kudos

, : can you assess this could be really related to the AppController?

eckart_liemke
Explorer
0 Kudos

Hi,

we have fixed a problem with multipart formdata recently. But not for SP11. For SP12, this fix is on its way.

Best regards,

Eckart

draschke
Active Contributor
0 Kudos

Hi Eckart,

we are on SPS12, is it a patch which is still not released?

Or should this error solved with our npm's

"dependencies": {
"express": "4.12.3",
"sap-xssec": ">=0.5.4",
"passport": ">=0.2.1",
"sap-hdbext": ">=2.0.4",
"sap-xsenv": ">=1.2.2",
"sap-xsjs": ">=1.6.4"
},
"description": "",
"devDependencies": {
"sap-xsjs-test": ">=1.0.7",
"compression": "1.6.0"
},

BR,

Dirk

eckart_liemke
Explorer
0 Kudos

Hi Dirk,

I just checked it. I has not yet been released for SP12

Unfortunately, it cannot be fixed via your npm dependencies, either.

Sorry for the trouble. The fix will hopefully be part of the next shipment.

Best regards,

Eckart

draschke
Active Contributor
0 Kudos

Thanks a lot!

Ok, than I'll wait for the next patch. Hopefully it doesn't 'll take so long.

But good to know that the next patch could be fix this problem.

Regards,

Dirk

(I'll close this thread as soon as the problem could be fixed.)

draschke
Active Contributor
0 Kudos

I should mention that it happens only with the Post request.

The Get Request works fine.

Former Member
0 Kudos

Hi Dirk,

(Sorry for the delay, public holiday in Israel)

When you say "move our SAPUI5" app - do you mean that you've imported the source code into the new web IDE for HANA or tried to run the application itself directly onto XS Advanced?

Regards,

Omer.

draschke
Active Contributor
0 Kudos

I imported it in the new Web IDE and build it there. After that we tried it to start.

(On the new xsa)

Thanks!

Nice greetings to Israel!

(I was wondering, how you could answer so fast, while you live in us. Now its clear to me.)

Former Member
0 Kudos

Thank you for the greets!

Regarding structure, I think you should have the xsodata file in a node.js module and the UI in a HTML5 module - Is this the structure of your application?

Can you please describe the folder layout of the app?

Also, can you please send the full error message which you receive?

Thanks,

Omer.

draschke
Active Contributor
0 Kudos

"Regarding structure, I think you should have the xsodata file in a node.js module and the UI in a HTML5 module - Is this the structure of your application?"

-->yes, its exactly the same structure, as you said. The xsodata file is within the lib folder.

If I check only the xsodata-service with a get request, that works fine.

Can you please describe the folder layout of the app?

Is that what you want?

Also, can you please send the full error message which you receive?

-->Will do it, but at this moment I get an other error. Will fix it and send you the whole exception message.

Former Member
0 Kudos

OK, so the next immediate suspects are the xs-app.json file and the dependencies of the js and ui modules:

For the xs-app.json, do you have there a route which uses the xsodata such as:

{
"welcomeFile": "index.html",
"authenticationMethod": "none",
"routes": [{
"source": "^/euro.xsodata/.*$",
"destination": "tinyjs_be"
}, {
"source": ".*\\.xsjs",
"destination": "tinyjs_be"
}]

}

Regarding dependencies, can you please attach the package.json files of both the js and ui modules?

Regards,

Omer.

draschke
Active Contributor
0 Kudos

xs-app.json

{

  "welcomeFile": "index.html",

  "authenticationMethod": "route",

  "routes": [{

  "source": "(.*)(.xsodata)",

  "csrfProtection": false,

  "destination": "nodejs_destination",

  "authenticationType": "xsuaa"

  },{

  "source": "(.*)(.xsjs)",

  "csrfProtection": false,

  "destination": "nodejs_destination",

  "authenticationType": "xsuaa"

  },

  {

  "source": "^/(.*)$",

  "csrfProtection": false,

  "destination": "nodejs_destination",

  "authenticationType": "xsuaa"

  }]

}

draschke
Active Contributor
0 Kudos

mta.yaml

# Don't use Tab Key

# You need to use space key

# Check with online validator for right syntax

_schema-version: 2.0.0

ID: TestTBASE

version: 0.0.1

modules:

- name: web

  type: html5

  path: web

# -- requires js service URL

  requires:

   - name: tbase-uaa

   - name: nodejs_api      # name of the 'provides' element in the node.js module

     group: destinations   # name of a target environment variable

     properties:           # key values in json format in the 'destinations' variabl

       name: nodejs_destination

       url:  ~{service_url}

       forwardAuthToken: true      

- name: db

  type: hdb

  path: db

  requires:

  - name: hdi-container

- name: js

  type: nodejs

  path: js

  requires:

  - name: tbase-uaa                # dependency on the UAA service 

  - name: db

  - name: hdi-container

  provides:

    - name: nodejs_api

      properties:

        service_url: ${default-url}

resources:

- name: hdi-container

  type: com.sap.xs.hdi-container

- name: tbase-uaa

  type: com.sap.xs.uaa

#  parameters:

#    config_path: ./xs-security.json

draschke
Active Contributor
0 Kudos

Omer, its not that the odata service doesn't work.

I checked the service, as Chaim it recommended in his blog. The services works!

Testing the OData service

Former Member
0 Kudos

Understood, can you please attach the package.json files of the node.js module?

I would like to see which xsjs version you are using.

Regards,

Omer.

draschke
Active Contributor
0 Kudos

package.json from nodejs folder

{

  "name": "js",

  "description": "",

  "version": "1.0.0",

  "main": "server.js",

  "scripts": {

  "start": "node server.js",

  "stop": ""

  },

  "files": [],

  "dependencies": {

  "sap-xsenv": "1.2.1",

  "sap-xsjs": "1.4.0",

  "express": "4.12.3",

  "sap-hdbext": "1.1.2",

  "sap-xssec": "0.5.3",

  "passport": "0.2.1",

  "async": "latest",

  "sap-textbundle": "latest",

  "accept-language": "latest"

  },

  "devDependencies": {

  "sap-xsjs-test": "1.0.3",

  "express": "4.12.3",

  "compression": "1.6.0"

  }

}

Former Member
0 Kudos

,: Do you know an issue with xsjs and OData using the above versions?

Thanks,

Omer.

chgeo
Advisor
Advisor
0 Kudos

Nope, nothing I know of.  Maybe OData folks can help here?

draschke
Active Contributor
0 Kudos

It would be help, if somebody could check, if it works.

Moving one simple MasterDetail App to XSA and try to start it. (within a simple odata-service on the master-side)

I would suppose that you would get the same error."Error: Unsupported content type: multipart/mixed;boundary=batch"

Master-Detail Template

SAPUI5 SDK - Demo Kit

Thanks!

0 Kudos

xsodata does'nt throw "Error: Unsupported content type: multipart/mixed;boundary=batch".

The xsodata library directly supports valid OData batch requests. E.g.  like

Header: Content-Type: multipart/mixed; boundary=batch_12345

Body:

--batch_12345

Content-Type: multipart/mixed; boundary=changeset_12345_A

--changeset_12345_A

Content-Type: application/http

Content-Transfer-Encoding: binary

POST /key_int_char_modify HTTP/1.1

....

So i suppose there error is thrown in a layer above the odata library.

christoph_pohl
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Dirk,

you could try the tinyworld tutorial on the SAP HANA SPS12 version released on May 11 this year on SMP. It comes with a newer "sap-xsjs": "1.6.4", which includes also a newer sap-xsodata version. Most likely, this issue is already solved there.

Best,

Christoph

draschke
Active Contributor
0 Kudos

Hi Christoph,

this is what we try to do. But at this moment we are not able to install the hrtt component.

After that we've fixed it, I'll give it a try again.

But as I said before, it would be nice if someone else could try it too.

Thanks,

Dirk

draschke
Active Contributor
0 Kudos

I totally agree with Sven "So i suppose the error is thrown in a layer above the odata library."