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 2018/10/14 09:12:57 UTC

[GitHub] patpatpat123 opened a new issue #4067: [Issue] 100% reproducible ok: invoked /guest/example, but the request has not yet finished, with id xxxx

patpatpat123 opened a new issue #4067: [Issue] 100% reproducible ok: invoked /guest/example, but the request has not yet finished, with id xxxx
URL: https://github.com/apache/incubator-openwhisk/issues/4067
 
 
   
   ## Environment details:
   
   * local deployment, (on Mac OS, with Docker and https://github.com/apache/incubator-openwhisk-devtools)
   
   >~/incubator-openwhisk-devtools$ git status
   On branch master
   Your branch is up to date with 'origin/master'.
   
   nothing to commit, working tree clean
   
   ## Steps to reproduce the issue:
   
   1.   run make quick-start from incubator-openwhisk-devtools/docker-compose
   result: 
   ok: whisk API host set to 192.168.1.5
   ok: whisk namespace set to guest
   waiting for the Whisk invoker to come up ... 
    ... OK
   creating the hello.js function ...
   invoking the hello-world function ... 
   adding the function to whisk ...
   ok: created action hello
   invoking the function ...
   invocation result: { "payload": "Hello, World!" }
   { "payload": "Hello, World!" }
   creating an API from the hello function ...
   ok: updated action hello
   invoking:  http://192.168.1.5:9090/api/23bc46b1-71f6-4ed5-8c54-816aa4f8c502/hello/world
     "payload": "Hello, World!"
   ok: APIs
   Action          Verb  API Name  URL
   /guest/hello     get    /hello  http://192.168.1.5:9090/api/23bc46b1-71f6-4ed5-8c54-816aa4f8c502/hello/world
   deleting the API ...
   ok: deleted API /hello
   deleting the function ...
   ok: deleted action hello
   To invoke the function again use: make hello-world
   To stop OpenWhisk use: make destroy
   
   2.   Created a java util Function
   package functions;
   
   import java.util.function.Function;
   
   public class Uppercase implements Function<String, String> {
   
       public String apply(String input) {
           return input.toUpperCase();
       }
   }
   
   $ tree
   .
   ├── Dockerfile
   ├── function.properties
   ├── pom.xml
   ├── runner.jar
   ├── src
   │   ├── main
   │   │   ├── java
   │   │   │   └── functions
   │   │   │       └── Uppercase.java
   │   │   └── resources
   │   └── test
   │       └── java
   ├── target
   │   ├── classes
   │   │   └── functions
   │   │       └── Uppercase.class
   │   ├── maven-archiver
   │   │   └── pom.properties
   │   ├── maven-status
   │   │   └── maven-compiler-plugin
   │   │       ├── compile
   │   │       │   └── default-compile
   │   │       │       ├── createdFiles.lst
   │   │       │       └── inputFiles.lst
   │   │       └── testCompile
   │   │           └── default-testCompile
   │   │               └── inputFiles.lst
   │   └── pof-0.0.1-SNAPSHOT.jar
   
    cat pom.xml 
   <?xml version="1.0" encoding="UTF-8"?>
   <project xmlns="http://maven.apache.org/POM/4.0.0"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
       <modelVersion>4.0.0</modelVersion>
   
       <groupId>com.example</groupId>
       <artifactId>pof</artifactId>
       <version>0.0.1-SNAPSHOT</version>
   
       <properties>
           <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
           <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
           <java.version>1.8</java.version>
       </properties>
   
   </project>
   
   $ cat Dockerfile
   FROM openjdk:8-jdk-alpine
   VOLUME /tmp
   COPY m2 /m2
   ADD runner.jar .
   ADD function.properties .
   ENV JAVA_OPTS=""
   ENTRYPOINT [ "java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "runner.jar", "--thin.root=/m2", "--thin.name=function", "--function.name=uppercase"]
   EXPOSE 8080
   
   $ cat function.properties 
   dependencies.function: com.example:pof:0.0.1-SNAPSHOT
   
   runner.jar is built using mvn clean package (with skip test = true) then cp into case level on the repo https://github.com/spring-cloud/spring-cloud-function/tree/master/spring-cloud-function-adapters.
   
   ![Uploading Screen Shot 2018-10-14 at 16.38.18.png…]()
    
   3.   run  java -jar -Dthin.root=m2 runner.jar --thin.name=function --thin.dryrun
   m2 properly generated under 
   
   16:42>~/IdeaProjects/test/try$ tree
   .
   ├── Dockerfile
   ├── function.properties
   ├── m2
   │   └── repository
   (with a lot of things here)
   ├── pom.xml
   
   
   4. 
   $ docker build -t xxx/test .
   Sending build context to Docker daemon  38.92MB
   Step 1/8 : FROM openjdk:8-jdk-alpine
    ---> 5801f7d008e5
   Step 2/8 : VOLUME /tmp
    ---> Using cache
    ---> 640a61be9dff
   Step 3/8 : COPY m2 /m2
    ---> a8bab352e5d8
   Step 4/8 : ADD runner.jar .
    ---> eb8da99e42ef
   Step 5/8 : ADD function.properties .
    ---> 7b0def2383c7
   Step 6/8 : ENV JAVA_OPTS=""
    ---> Running in ce2c1efd05e5
   Removing intermediate container ce2c1efd05e5
    ---> d8ef510682c6
   Step 7/8 : ENTRYPOINT [ "java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "runner.jar", "--thin.root=/m2", "--thin.name=function", "--function.name=uppercase"]
    ---> Running in 19ce4a331b3b
   Removing intermediate container 19ce4a331b3b
    ---> 6434953285d2
   Step 8/8 : EXPOSE 8080
    ---> Running in 03fcf27b10bf
   Removing intermediate container 03fcf27b10bf
    ---> 4fed9f9d1c50
   Successfully built 4fed9f9d1c50
   Successfully tagged xxx/test:latest
   
   docker push xxx/test
   
   5. $ wsk **-i -d -v** action create example --docker xxx/test
   [commands.NewQualifiedName]:132:[Inf] Qualified pkg+entity (EntityName): example
   [commands.NewQualifiedName]:133:[Inf] Qualified namespace: guest
   [commands.NewQualifiedName]:134:[Inf] Qualified package: 
   [commands.NewQualifiedName]:135:[Inf] Qualified entity: example
   [-cli/commands.parseAction]:474:[Inf] Parsed action struct: &whisk.Action{Namespace:"guest", Name:"example", Version:"", Exec:(*whisk.Exec)(0xc42024ba40), Annotations:whisk.KeyValueArr(nil), Parameters:whisk.KeyValueArr(nil), Limits:(*whisk.Limits)(nil), Error:"", Code:0, Publish:(*bool)(nil)}
   [li/commands.augmentWebArg]:528:[Inf] augmentWebArg: Augmented action struct: &whisk.Action{Namespace:"guest", Name:"example", Version:"", Exec:(*whisk.Exec)(0xc42024ba40), Annotations:whisk.KeyValueArr(nil), Parameters:whisk.KeyValueArr(nil), Limits:(*whisk.Limits)(nil), Error:"", Code:0, Publish:(*bool)(nil)}
   [hisk.KeyValueArr.GetValue]:044:[Inf] Got value '<nil>' for key 'web-export' from '[]'
   [go/whisk.Action.WebAction]:116:[Inf] Web export value is 'false'
   [mands.augmentWebSecureArg]:570:[Inf] augmentWebSecureArg: Augmented action struct: &whisk.Action{Namespace:"guest", Name:"example", Version:"", Exec:(*whisk.Exec)(0xc42024ba40), Annotations:whisk.KeyValueArr(nil), Parameters:whisk.KeyValueArr(nil), Limits:(*whisk.Limits)(nil), Error:"", Code:0, Publish:(*bool)(nil)}
   [li/commands.augmentAction]:504:[Inf] Augmented action struct: &whisk.Action{Namespace:"guest", Name:"example", Version:"", Exec:(*whisk.Exec)(0xc42024ba40), Annotations:whisk.KeyValueArr(nil), Parameters:whisk.KeyValueArr(nil), Limits:(*whisk.Limits)(nil), Error:"", Code:0, Publish:(*bool)(nil)}
   [k.(*ActionService).Insert]:212:[Inf] Action insert route: actions/example?overwrite=false
   [k.(*Client).addAuthHeader]:298:[Inf] Adding basic auth header; using authkey
   REQUEST:
   [PUT]   https://192.168.1.5/api/v1/namespaces/guest/actions/example?overwrite=false
   Req Headers
   {
     "Authorization": [
       "Basic ..."
     ],
     "Content-Type": [
       "application/json"
     ],
     "User-Agent": [
       "CloudFunctions-CLI/1.0 (2018-07-12T22:20:03+00:00) darwin amd64"
     ]
   }
   Req Body
   {"namespace":"guest","name":"example","exec":{"kind":"blackbox","image":"xxx/test"}}
   
   [go/whisk.PrintRequestInfo]:458:[Inf] Req Body (ASCII quoted string):
   "{\"namespace\":\"guest\",\"name\":\"example\",\"exec\":{\"kind\":\"blackbox\",\"image\":\"xxx/test\"}}\n"
   RESPONSE:Got response with code 200
   Resp Headers
   {
     "Access-Control-Allow-Headers": [
       "*"
     ],
     "Access-Control-Allow-Methods": [
       "GET, DELETE, POST, PUT, HEAD"
     ],
     "Access-Control-Allow-Origin": [
       "*"
     ],
     "Connection": [
       "keep-alive"
     ],
     "Content-Length": [
       "256"
     ],
     "Content-Type": [
       "application/json"
     ],
     "Date": [
       "Sun, 14 Oct 2018 08:48:47 GMT"
     ],
     "Server": [
       "openresty/1.13.6.2"
     ],
     "X-Request-Id": [
       "QcYROaUQH3rq9sLekx5lCTGDaUJJATqj"
     ]
   }
   Response body size is 256 bytes
   Response body received:
   {"name":"example","publish":false,"annotations":[{"key":"exec","value":"blackbox"}],"version":"0.0.1","exec":{"kind":"blackbox","image":"xxx/test","binary":false},"parameters":[],"limits":{"timeout":60000,"memory":256,"logs":10},"namespace":"guest"}
   [o/whisk.PrintResponseInfo]:499:[Inf] Response body received (ASCII quoted string):
   "{\"name\":\"example\",\"publish\":false,\"annotations\":[{\"key\":\"exec\",\"value\":\"blackbox\"}],\"version\":\"0.0.1\",\"exec\":{\"kind\":\"blackbox\",\"image\":\"xxx/test\",\"binary\":false},\"parameters\":[],\"limits\":{\"timeout\":60000,\"memory\":256,\"logs\":10},\"namespace\":\"guest\"}"
   [k.IsResponseResultSuccess]:658:[Wrn] IsResponseResultSuccess: failed to parse response result: <nil>
   [hisk.parseSuccessResponse]:583:[Inf] Parsing HTTP response into struct type: **whisk.Action
   [hisk.parseSuccessResponse]:592:[Inf] Successful parse of HTTP response into struct type: **whisk.Action
   **ok: created action example**
   
   
   ## Provide the expected results and outputs:
   
   ```
   wsk action invoke example --result --param payload foo
   {
       "result": "FOO"
   }
   ```
   
   
   ## Provide the actual results and outputs:
   
   ```
   $ wsk -i -d -v action invoke example --result --param payload foo
   [commands.NewQualifiedName]:132:[Inf] Qualified pkg+entity (EntityName): example
   [commands.NewQualifiedName]:133:[Inf] Qualified namespace: guest
   [commands.NewQualifiedName]:134:[Inf] Qualified package: 
   [commands.NewQualifiedName]:135:[Inf] Qualified entity: example
   [li/commands.getParameters]:071:[Inf] Parsing parameters: []string{"{\"payload\": \"foo\"}"}
   [mmands.getJSONFromStrings]:099:[Inf] Convert content to JSON: []string{"{\"payload\": \"foo\"}"}
   [mmands.getJSONFromStrings]:109:[Inf] Created map 'map[payload:foo]' from '{"payload": "foo"}'
   [k.(*ActionService).Invoke]:294:[Inf] HTTP route: actions/example?blocking=true&result=true
   [k.(*Client).addAuthHeader]:298:[Inf] Adding basic auth header; using authkey
   REQUEST:
   [POST]  https://192.168.1.5/api/v1/namespaces/guest/actions/example?blocking=true&result=true
   Req Headers
   {
     "Authorization": [
       "Basic MjNiYzQ2YjEtNzFmNi00ZWQ1LThjNTQtODE2YWE0ZjhjNTAyOjEyM3pPM3haQ0xyTU42djJCS0sxZFhZRnBYbFBrY2NPRnFtMTJDZEFzTWdSVTRWck5aOWx5R1ZDR3VNREdJd1A="
     ],
     "Content-Type": [
       "application/json"
     ],
     "User-Agent": [
       "CloudFunctions-CLI/1.0 (2018-07-12T22:20:03+00:00) darwin amd64"
     ]
   }
   Req Body
   {"payload":"foo"}
   
   [go/whisk.PrintRequestInfo]:458:[Inf] Req Body (ASCII quoted string):
   "{\"payload\":\"foo\"}\n"
   RESPONSE:Got response with code 202
   Resp Headers
   {
     "Access-Control-Allow-Headers": [
       "*"
     ],
     "Access-Control-Allow-Methods": [
       "GET, DELETE, POST, PUT, HEAD"
     ],
     "Access-Control-Allow-Origin": [
       "*"
     ],
     "Connection": [
       "keep-alive"
     ],
     "Content-Length": [
       "51"
     ],
     "Content-Type": [
       "application/json"
     ],
     "Date": [
       "Sun, 14 Oct 2018 08:52:57 GMT"
     ],
     "Server": [
       "openresty/1.13.6.2"
     ],
     "X-Openwhisk-Activation-Id": [
       "170612190ff544208612190ff5842001"
     ],
     "X-Request-Id": [
       "ijVizEIkPVySPYw7lHjjKnRueHpJlNw0"
     ]
   }
   Response body size is 51 bytes
   Response body received:
   {"activationId":"170612190ff544208612190ff5842001"}
   [o/whisk.PrintResponseInfo]:499:[Inf] Response body received (ASCII quoted string):
   "{\"activationId\":\"170612190ff544208612190ff5842001\"}"
   [hisk.parseSuccessResponse]:583:[Inf] Parsing HTTP response into struct type: *map[string]interface {}
   [hisk.parseSuccessResponse]:592:[Inf] Successful parse of HTTP response into struct type: *map[string]interface {}
   [k.(*ActionService).Invoke]:309:[Err] s.client.Do() error - HTTP req https://192.168.1.5/api/v1/namespaces/guest/actions/example?blocking=true&result=true; error 'Request accepted, but processing not completed yet.'
   ok: invoked /guest/example, but the request has not yet finished, with id 170612190ff544208612190ff5842001
   [main.main                ]:068:[Inf] err object type: *whisk.WskError
   [main.main                ]:072:[Err] Got a *whisk.WskError error: &whisk.WskError{RootErr:(*errors.errorString)(0xc42029f820), ExitCode:202, DisplayMsg:false, MsgDisplayed:false, DisplayUsage:false, DisplayPrefix:false, ApplicationError:false, TimedOut:true}
   
   ```
   
   ## Additional information you deem important:
   * reproducible 100%
   * find this very strange, do not know if it is related.
   $ docker ps -a
   CONTAINER ID        IMAGE                                      COMMAND                  CREATED             STATUS                                PORTS                                                                                                NAMES
   8e7a0ff1ac15        xxx/test                            "java -Djava.securit…"   52 seconds ago      Exited (137) Less than a second ago
   
   If I start the image locally, without OpenWhisk, it is working
   
   $ docker run -p 8080:8080 xxx/test
   
     .   ____          _            __ _ _
    /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
   ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
    \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
     '  |____| .__|_| |_|_| |_\__, | / / / /
    =========|_|==============|___/=/_/_/_/
    :: Spring Boot ::  (v2.1.0.BUILD-SNAPSHOT)
   
   2018-10-14 08:57:23.711  INFO 1 --- [           main] o.s.c.f.a.o.OpenWhiskActionApplication   : Starting OpenWhiskActionApplication v2.0.0.BUILD-SNAPSHOT on c0d499e515b6 with PID 1 (/runner.jar started by root in /)
   2018-10-14 08:57:23.724  INFO 1 --- [           main] o.s.c.f.a.o.OpenWhiskActionApplication   : No active profile set, falling back to default profiles: default
   2018-10-14 08:57:25.292  INFO 1 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
   2018-10-14 08:57:25.335  INFO 1 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
   2018-10-14 08:57:25.335  INFO 1 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet Engine: Apache Tomcat/9.0.12
   2018-10-14 08:57:25.348  INFO 1 --- [           main] o.a.catalina.core.AprLifecycleListener   : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/usr/lib/jvm/java-1.8-openjdk/jre/lib/amd64/server:/usr/lib/jvm/java-1.8-openjdk/jre/lib/amd64:/usr/lib/jvm/java-1.8-openjdk/jre/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib]
   2018-10-14 08:57:25.466  INFO 1 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
   2018-10-14 08:57:25.467  INFO 1 --- [           main] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 1629 ms
   2018-10-14 08:57:25.496  INFO 1 --- [           main] o.s.b.w.servlet.ServletRegistrationBean  : Servlet dispatcherServlet mapped to [/]
   2018-10-14 08:57:25.499  INFO 1 --- [           main] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'characterEncodingFilter' to: [/*]
   2018-10-14 08:57:25.499  INFO 1 --- [           main] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
   2018-10-14 08:57:25.499  INFO 1 --- [           main] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'formContentFilter' to: [/*]
   2018-10-14 08:57:25.499  INFO 1 --- [           main] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'requestContextFilter' to: [/*]
   2018-10-14 08:57:25.687  INFO 1 --- [           main] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'
   2018-10-14 08:57:26.221  INFO 1 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''
   2018-10-14 08:57:26.229  INFO 1 --- [           main] o.s.c.f.a.o.OpenWhiskActionApplication   : Started OpenWhiskActionApplication in 3.261 seconds (JVM running for 10.572)
   
   But curl from localhost or postman requests are failing, I do not know if it is related.
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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