Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] invalid values in service-path with update PATCH never respond #1280

Closed
iariasleon opened this issue Sep 23, 2015 · 6 comments
Closed
Assignees
Milestone

Comments

@iariasleon
Copy link
Contributor

When try tu update an attribute with PATCH request, but we use an invalid service-path never return a response.

Request:

  PATCH http://<host>:<port>/v2/entities/room
  Content-Type: application/json
  Fiware-Service: test_update_service_path_error  
  Fiware-ServicePath: /service.sr
  {"temperature": "80"}

Dataset:

      | service_path |
      |--------------|
      | /service.sr  |
      | /service;sr  |
      | /service=sr  |
      | /Service-sr  |
      | /serv<45>    |
      | /serv(45)    |
      | sdffsfs      |
      | /service,sr  |
      | greater than max length allowed                |
      | greater than max length allowed and ten levels |
      | max length allowed and eleven levels           |

Log:

DEBUG@12:01:46  sem.cpp[215]: transactionIdSet taking the 'trans' semaphore for 'changing the transaction id'
DEBUG@12:01:46  sem.cpp[236]: transactionIdSet has the 'trans' semaphore
DEBUG@12:01:46  sem.cpp[276]: transactionIdSet gives the 'trans' semaphore for 'changing the transaction id'
INFO@12:01:46  rest.cpp[910]: Starting transaction from 127.0.1.1:34242/v2/entities/room
DEBUG@12:01:46  rest.cpp[237]: HTTP Header:   User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.19.1 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2
DEBUG@12:01:46  rest.cpp[237]: HTTP Header:   Host: qa-orion-fe-02:1026
DEBUG@12:01:46  rest.cpp[237]: HTTP Header:   Accept: */*
DEBUG@12:01:46  rest.cpp[237]: HTTP Header:   Content-Type: application/json
DEBUG@12:01:46  rest.cpp[237]: HTTP Header:   Fiware-Service: test_update_service_path_error
DEBUG@12:01:46  rest.cpp[237]: HTTP Header:   Fiware-ServicePath: /service.rs
DEBUG@12:01:46  rest.cpp[237]: HTTP Header:   Content-Length: 21
DEBUG@12:01:46  rest.cpp[619]: Service Path 0: '/service.rs'
WARNING@12:01:46  rest.cpp[947]: Bad Input (error in ServicePath http-header)
DEBUG@12:01:46  restReply.cpp[67]: Response 8: responding with 95 bytes, Status Code 400
DEBUG@12:01:46  restReply.cpp[68]: Response payload: '{"error":"BadRequest","description":"a component of ServicePath contains an illegal character"}'
WARNING@12:01:46  rest.cpp[967]: Bad Input (error in URI parameters)
DEBUG@12:01:46  restReply.cpp[67]: Response 9: responding with 95 bytes, Status Code 400
DEBUG@12:01:46  restReply.cpp[68]: Response payload: '{"error":"BadRequest","description":"a component of ServicePath contains an illegal character"}'
@iariasleon iariasleon added this to the 0.25.0 milestone Sep 23, 2015
@kzangeli
Copy link
Member

According to the traces, it seems the broker responds, right?
If no response is received from the broker, does the broker crash?

@rbl219 rbl219 self-assigned this Sep 23, 2015
@iariasleon
Copy link
Contributor Author

no, not crash, continue processing another requests successfully, but this request never responds, indefinitely.

@fgalan
Copy link
Member

fgalan commented Sep 23, 2015

It could be checked with lsof if the thread in charge of the request is blocked.

@kzangeli
Copy link
Member

So, it is in restReply.cpp, line 68 (function restReply), saying "Response payload: XXX" but it actually never writes to the socket ...

Very strange indeed.

rbl219 pushed a commit that referenced this issue Sep 25, 2015
Update PATCH request with invalid service-path never return a response
@fgalan
Copy link
Member

fgalan commented Sep 29, 2015

Fixed in PR #1280. @iariasleon please have a look and close if you find it is ok.

@fgalan fgalan assigned iariasleon and unassigned rbl219 Sep 29, 2015
@iariasleon
Copy link
Contributor Author

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants