0

well i have record a script using Badboy and export it to Jmeter. the script include a post request that initiates a file with a name.

Parameter send with the request

noCache=1404378079862 {"alf_destination":"workspace://SpacesStore/${UUID}","prop_cm_name":"File _2","prop_cm_title":"","prop_cm_description":""}

Every time I run the test plan i get an 500 error code (internal server error) response for the POST request it looks like this

{ "status" : { "code" : 500, "name" : "Internal Error", "description" : "An error inside the HTTP server which prevented it from fulfilling the request." }, so i used chrome developer tool to capture the request and i've found that when i attempted to create a file with name that is already exist the server respond with the 500 error code also i found that the request that is sent by jmeter is different than what i captured with developer tool hear isthe one sent by jmeter:

POST https://${ServerName}/share/proxy/alfresco/api/type/cm%3acontent/formprocessor

and hear is the one i captured by the developer tool:

POST https://${ServerName}/share/proxy/alfresco/api/type/cm%3acontent/formprocessor?noCache=1404586721426&{"alf_destination":"workspace://SpacesStore/${uuid}","prop_cm_name":"file_2,"prop_cm_title":"","prop_cm_description":"","prop_cm_content":"Ramadan kareem","prop_mimetype":"text/plain","prop_app_editInline":"true"}

i changed that name of the file i want to create but still getting the same error i have searched for solution but nothing changed. i tried to clear the cache and cookies after each iteration but it also did not work.

and here are the full request made by jmeter

POST https://${server}/share/proxy/alfresco/api/type/cm%3acontent/formprocessor

POST data: noCache=1404586721426&%7B%22alf_destination%22%3A%22workspace%3A%2F%2FSpacesStore%2F${uuid}%22%2C%22prop_cm_name%22%3A%22file_2%2C%22prop_cm_title%22%3A%22%22%2C%22prop_cm_description%22%3A%22%22%2C%22prop_cm_content%22%3A%22Ramadan+kareem%22%2C%22prop_mimetype%22%3A%22text%2Fplain%22%2C%22prop_app_editInline%22%3A%22true%22%7D=

Cookie Data: $Version=0; JSESSIONID=6508CDFBEF16F2D601CF1E672EB00D62.worker2; $Path=/share/; alfLogin=1404810408; $Path=/share; alfUsername3=jmeter01; $Path=/share; NSC_NzTibsf_TTM=ffffffff09f01c8f45525d5f4f58455e445a4a42378b; $Path=/

Request Headers: Connection: keep-alive Alfresco-CSRFToken: ${COOKIE_Alfresco-CSRFToken} Content-Type: application/json;charset=UTF-8 Content-Length: 359 Host: myshare.kfshrc.edu.sa User-Agent: Apache-HttpClient/4.2.6 (java 1.5)

can any one explain why i get this error?

Ori Marko
  • 56,308
  • 23
  • 131
  • 233
Wejdan
  • 63
  • 2
  • 12

2 Answers2

1

Can you post the rest of stacktrace? It doesn't expose the main cause and the cause may be different.

I expect that if you're trying to performance test Alfresco system of version 4.1.7 or higher the request may fail due to CSRF filter protection which is being set via cookie and needs to be sent as Alfresco-CSRFToken header.

To bypass it consider the following:

  1. Add a HTTP Cookie Manager to your Test Plan
  2. In jmeter.properties file (lives under /bin folder of your JMeter installation) define the following property: CookieManager.save.cookies=true
  3. Restart JMeter (property change is not dynamic)
  4. Add a HTTP Header Manager as a child of the request which is failing. Populate it as follows:

    • Header 1
      • Name: Alfresco-CSRFToken
      • Value: ${__javaScript(decodeURIComponent("${COOKIE_Alfresco-CSRFToken}"),)}
    • Header 2
      • Name: Content-Type
      • Value: application/json;charset=UTF-8

Hope this helps.

Dmitri T
  • 159,985
  • 5
  • 83
  • 133
0

It's because the file might be corrupted in the server side. Mostly this is due server side problem. Try with different site to reproduce it.