You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "lauri-aloauri (via GitHub)" <gi...@apache.org> on 2023/06/08 06:37:08 UTC

[GitHub] [apisix] lauri-aloauri opened a new issue, #9625: help request: body-transformer response templete troubles

lauri-aloauri opened a new issue, #9625:
URL: https://github.com/apache/apisix/issues/9625

   ### Description
   
   Hi !
   
   I'm experimenting with body-transformer plugin and i run into trouble , then the upstream request returns SOAP xml then there is in the  body <Kood></Kood> then  REST request  response  is strange    "Kood": "table: 0x7f5a42dfe048" . But then there is in body has  in between the tags like <Kood>916</Kood> then all works well.
   Then i make many REST request there there  <Kood></Kood> the the response is diferent the part what is behind the table for example "Kood": "table: 0x7f5a42402100".
   
   Lauri-Alo Adamson
   
   ### Environment
   
   - APISIX version (run `apisix version`):
   - Operating system (run `uname -a`):
   - OpenResty / Nginx version (run `openresty -V` or `nginx -V`):
   - etcd version, if relevant (run `curl http://127.0.0.1:9090/v1/server_info`):
   - APISIX Dashboard version, if relevant:
   - Plugin runner version, for issues related to plugin runners:
   - LuaRocks version, for installation issues (run `luarocks --version`):
   apisix version
   /usr/local/openresty//luajit/bin/luajit /usr/local/apisix/apisix/cli/apisix.lua version
   3.3.0
   
   uname -a
   Linux apispx 5.10.0-23-amd64 #1 SMP Debian 5.10.179-1 (2023-05-12) x86_64 GNU/Linux
   
   openresty -V
   nginx version: openresty/1.21.4.1
   built by gcc 10.2.1 20210110 (Debian 10.2.1-6)
   built with OpenSSL 1.1.1s  1 Nov 2022
   TLS SNI support enabled
   configure arguments: --prefix=/usr/local/openresty/nginx --with-cc-opt='-O2 -DAPISIX_BASE_VER=1.21.4.1.8 -DNGX_GRPC_CLI_ENGINE_PATH=/usr/local/openresty/libgrpc_engine.so -DNGX_HTTP_GRPC_CLI_ENGINE_PATH=/usr/local/openresty/libgrpc_engine.so -DNGX_LUA_ABORT_AT_PANIC -I/usr/local/openresty/zlib/include -I/usr/local/openresty/pcre/include -I/usr/local/openresty/openssl111/include' --add-module=../ngx_devel_kit-0.3.1 --add-module=../echo-nginx-module-0.62 --add-module=../xss-nginx-module-0.06 --add-module=../ngx_coolkit-0.2 --add-module=../set-misc-nginx-module-0.33 --add-module=../form-input-nginx-module-0.12 --add-module=../encrypted-session-nginx-module-0.09 --add-module=../srcache-nginx-module-0.32 --add-module=../ngx_lua-0.10.21 --add-module=../ngx_lua_upstream-0.07 --add-module=../headers-more-nginx-module-0.33 --add-module=../array-var-nginx-module-0.05 --add-module=../memc-nginx-module-0.19 --add-module=../redis2-nginx-module-0.15 --add-module=../redis-nginx-module-0.3.9 --ad
 d-module=../ngx_stream_lua-0.0.11 --with-ld-opt='-Wl,-rpath,/usr/local/openresty/luajit/lib -Wl,-rpath,/usr/local/openresty/wasmtime-c-api/lib -L/usr/local/openresty/zlib/lib -L/usr/local/openresty/pcre/lib -L/usr/local/openresty/openssl111/lib -Wl,-rpath,/usr/local/openresty/zlib/lib:/usr/local/openresty/pcre/lib:/usr/local/openresty/openssl111/lib' --add-module=/tmp/tmp.kOo9UFlgbS/openresty-1.21.4.1/../mod_dubbo-1.0.2 --add-module=/tmp/tmp.kOo9UFlgbS/openresty-1.21.4.1/../ngx_multi_upstream_module-1.1.1 --add-module=/tmp/tmp.kOo9UFlgbS/openresty-1.21.4.1/../apisix-nginx-module-1.12.0 --add-module=/tmp/tmp.kOo9UFlgbS/openresty-1.21.4.1/../apisix-nginx-module-1.12.0/src/stream --add-module=/tmp/tmp.kOo9UFlgbS/openresty-1.21.4.1/../apisix-nginx-module-1.12.0/src/meta --add-module=/tmp/tmp.kOo9UFlgbS/openresty-1.21.4.1/../wasm-nginx-module-0.6.4 --add-module=/tmp/tmp.kOo9UFlgbS/openresty-1.21.4.1/../lua-var-nginx-module-v0.5.3 --add-module=/tmp/tmp.kOo9UFlgbS/openresty-1.21.4.1/../grp
 c-client-nginx-module-v0.4.2 --with-poll_module --with-pcre-jit --with-stream --with-stream_ssl_module --with-stream_ssl_preread_module --with-http_v2_module --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module --with-http_stub_status_module --with-http_realip_module --with-http_addition_module --with-http_auth_request_module --with-http_secure_link_module --with-http_random_index_module --with-http_gzip_static_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-threads --with-compat --with-stream --with-http_ssl_module
   
   url http://127.0.0.1:9090/v1/server_info
   {"id":"62bd3dbe-31cd-4448-ba30-810a070bad61","boot_time":1685961093,"etcd_version":"3.5.0","version":"3.3.0","hostname":"apispx"}
   
   
   
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] monkeyDluffy6017 closed issue #9625: help request: body-transformer response templete troubles

Posted by "monkeyDluffy6017 (via GitHub)" <gi...@apache.org>.
monkeyDluffy6017 closed issue #9625: help request: body-transformer response templete troubles
URL: https://github.com/apache/apisix/issues/9625


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] kingluo commented on issue #9625: help request: body-transformer response templete troubles

Posted by "kingluo (via GitHub)" <gi...@apache.org>.
kingluo commented on issue #9625:
URL: https://github.com/apache/apisix/issues/9625#issuecomment-1583936556

   Please show your configuration and logs.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] kingluo commented on issue #9625: help request: body-transformer response templete troubles

Posted by "kingluo (via GitHub)" <gi...@apache.org>.
kingluo commented on issue #9625:
URL: https://github.com/apache/apisix/issues/9625#issuecomment-1584773553

   Ok, I think it's a bug. For empty xml value, it's represented as an empty table, so that's why the template renders it as table pointer. I'll submit the bugfix next week.
   
   And, it's werid that the first two responses could be not decoded as XML. In fact, I copy the content from error.log and uses xml2lua to decode it manually and it's successful. So does the two responses has no `Content-Type` header? If so, you need to specify `input_format` as `xml` explicitly.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] lauri-aloauri commented on issue #9625: help request: body-transformer response templete troubles

Posted by "lauri-aloauri (via GitHub)" <gi...@apache.org>.
lauri-aloauri commented on issue #9625:
URL: https://github.com/apache/apisix/issues/9625#issuecomment-1584634468

   Additional information - i added files with configuration information and log files
   At first the REST request do not returned anything - there are  records inside error-log.txt file for these two request for these requests
   ```
   curl -s http://127.0.0.1:9080/cgi-bin/consumer_proxy     -H 'content-type: application/json'     -X POST -d '{"userid": "EE33333333333","requestIsikukood": "44444444444"}' | jq
   curl -s http://127.0.0.1:9080/cgi-bin/consumer_proxy     -H 'content-type: application/json'     -X POST -d '{"userid": "EE33333333333","requestIsikukood": "44444444444"}' | jq
   
   After two request all worked well as expected
   curl -s http://127.0.0.1:9080/cgi-bin/consumer_proxy     -H 'content-type: application/json'     -X POST -d '{"userid": "EE33333333333","requestIsikukood": "44444444444"}' | jq
   {
     "status": "200",
     "requestIsikukood": "44444444444",
     "KOVKood": "919",
     "responseIsikukood": "44444444444"
   }
   
   ```
   ```
   curl -s http://127.0.0.1:9080/cgi-bin/consumer_proxy     -H 'content-type: application/json'     -X POST -d '{"userid": "EE33333333333","requestIsikukood": "44444444444"}' | jq
   {
     "status": "200",
     "requestIsikukood": "44444444444",
     "KOVKood": "919",
     "responseIsikukood": "44444444444"
   }
   
   Case then the SOAP response has `<KOVKood></KOVKood>` look file that i  captured  with tcpdump output as soap-request-respnse.txt 
    curl -s http://127.0.0.1:9080/cgi-bin/consumer_proxy     -H 'content-type: application/json'     -X POST -d '{"userid": "EE33333333333","requestIsikukood": "33333333333"}' | jq
   {
     "status": "200",
     "requestIsikukood": "33333333333",
     "KOVKood": "table: 0x7f042a5aa728",
     "responseIsikukood": "33333333333"
   }
   
    curl -s http://127.0.0.1:9080/cgi-bin/consumer_proxy     -H 'content-type: application/json'     -X POST -d '{"userid": "EE33333333333","requestIsikukood": "33333333333"}' | jq
   {
     "status": "200",
     "requestIsikukood": "33333333333",
     "KOVKood": "table: 0x7f042a4d01b0",
     "responseIsikukood": "33333333333"
   }
   
   ```
   [accesslog.txt](https://github.com/apache/apisix/files/11707027/accesslog.txt)
   [enable-plugin.txt](https://github.com/apache/apisix/files/11707028/enable-plugin.txt)
   [error-log.txt](https://github.com/apache/apisix/files/11707029/error-log.txt)
   [request_template.txt](https://github.com/apache/apisix/files/11707030/request_template.txt)
   [response_template.txt](https://github.com/apache/apisix/files/11707031/response_template.txt)
   [soap-request-respnse.txt](https://github.com/apache/apisix/files/11707032/soap-request-respnse.txt)
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] lauri-aloauri commented on issue #9625: help request: body-transformer response templete troubles

Posted by "lauri-aloauri (via GitHub)" <gi...@apache.org>.
lauri-aloauri commented on issue #9625:
URL: https://github.com/apache/apisix/issues/9625#issuecomment-1586598913

   Hi !
   
   Many thanks for your reply . I plan to experiment further with TLS with upstream and routing , key authentication, mTLS for client etc.
   
   Lauri-Alo Adamson


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org