You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2019/03/20 15:45:34 UTC

[GitHub] [incubator-openwhisk] neerajmangal opened a new issue #4359: Not able to create new action. PUT request downgraded to GET on controller.

neerajmangal opened a new issue #4359: Not able to create new action. PUT request downgraded to GET on controller. 
URL: https://github.com/apache/incubator-openwhisk/issues/4359
 
 
   
   ## Environment details:
   
   * ubuntu distributed   
   * Docker version 18.09.3
   * Ubuntu Ubuntu 16.04.5 LTS
   
   ## Steps to reproduce the issue:
   
   1. Deploy Openwhisk in a distributed ubuntu setup
   2. wsk -i action create hello hello.js
   
   
   ## Provide the expected results and outputs:
   
   Action should be created successfully. 
   
   ## Provide the actual results and outputs:
   
   ```
   error: Unable to create action 'hello': The requested resource does not exist. (code 20472fe3528ceb6c582da7ce5c7675b5)
   Run 'wsk --help' for usage.
   
   ```
   
   ## Additional information you deem important:
   I looked at the controller logs and nginx logs. Seems like the controller is getting the GET request instead of PUT request from nginx. 
   
   **NGINX Logs**
   ```
   X.X.X.X - 23bc46b1-71f6-4ed5-8c54-816aa4f8c502 [20/Mar/2019:15:09:42 +0000] [#tid_4ba6edde8f46c31f7bf1f0649b67d20e] PUT /api/v1/namespaces/guest/actions/hello?overwrite=false HTTP/1.1 301 178 - OpenWhisk-CLI/1.0 (2019-03-16T12:40:20.831+0000) linux amd64 -
   X.X.X.X - 23bc46b1-71f6-4ed5-8c54-816aa4f8c502 [20/Mar/2019:15:09:42 +0000] [#tid_20472fe3528ceb6c582da7ce5c7675b5] GET /api/v1/namespaces/guest/actions/hello?overwrite=false HTTP/1.1 404 92 http://ege.domain.com/api/v1/namespaces/guest/actions/hello?overwrite=false OpenWhisk-CLI/1.0 (2019-03-16T12:40:20.831+0000) linux amd64 X.X.X.X:10001
   ```
   
   If you see the above log, when Nginx receives the request, it redirection happens and the request is downgraded to GET from PUT.  
   
   This behavior can be verified in controller logs. 
   **Controller logs for same tid**
   ```
   [2019-03-20T15:09:42.504Z] [INFO] [#tid_20472fe3528ceb6c582da7ce5c7675b5] GET /api/v1/namespaces/guest/actions/hello overwrite=false
   [2019-03-20T15:09:42.510Z] [INFO] [#tid_20472fe3528ceb6c582da7ce5c7675b5] [BasicAuthenticationDirective] authenticate: 23bc46b1-71f6-4ed5-8c54-816aa4f8c502
   [2019-03-20T15:09:42.519Z] [INFO] [#tid_20472fe3528ceb6c582da7ce5c7675b5] [Identity] [GET] serving from datastore: CacheKey(23bc46b1-71f6-4ed5-8c54-816aa4f8c502) [marker:database_cacheMiss_count:15]
   [2019-03-20T15:09:42.520Z] [INFO] [#tid_20472fe3528ceb6c582da7ce5c7675b5] [CouchDbRestStore] [QUERY] 'whisk_local_subjects' searching 'subjects/identities [marker:database_queryView_start:16]
   [2019-03-20T15:09:42.544Z] [INFO] [#tid_20472fe3528ceb6c582da7ce5c7675b5] [CouchDbRestStore]  [marker:database_queryView_finish:39:23]
   [2019-03-20T15:09:42.545Z] [INFO] [#tid_20472fe3528ceb6c582da7ce5c7675b5] [WhiskAction] [GET] serving from datastore: CacheKey(guest/hello) [marker:database_cacheMiss_count:41]
   [2019-03-20T15:09:42.546Z] [INFO] [#tid_20472fe3528ceb6c582da7ce5c7675b5] [CouchDbRestStore] [GET] 'whisk_local_whisks' finding document: 'id: guest/hello' [marker:database_getDocument_start:41]
   [2019-03-20T15:09:42.550Z] [INFO] [#tid_20472fe3528ceb6c582da7ce5c7675b5] [CouchDbRestStore]  [marker:database_getDocument_finish:46:5]
   [2019-03-20T15:09:42.551Z] [INFO] [#tid_20472fe3528ceb6c582da7ce5c7675b5] [WhiskAction] invalidating CacheKey(guest/hello)
   [2019-03-20T15:09:42.551Z] [INFO] [#tid_20472fe3528ceb6c582da7ce5c7675b5] [BasicHttpService] [marker:http_get.404_count:47:47]
   ``` 
   
   I might be wrong but I am suspecting this issue due to recent changes done in https://github.com/apache/incubator-openwhisk/pull/4329 with 301 redirection. 
   
   https://developer.mozilla.org/en-US/docs/Web/HTTP/Redirections#Permanent_redirections 
   
   Based on the above link should we use 308 redirection. WDYT? 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services