tapis-project / tapis-java

Texas Advanced Computing Center APIs
BSD 3-Clause "New" or "Revised" License
5 stars 6 forks source link

v3/meta POST returns 500 error #112

Closed schristley closed 1 year ago

schristley commented 1 year ago

This is on the VDServer tenant. When create a document using the POST end point, the document gets created properly within the collection but a 500 error is returned.

$ curl -v -H "X-Tapis-Token: $JWT" -H "Content-type: application/json" --data '{"test":"test"}' https://vdjserver.tapis.io/v3/meta/v1airr/query

*   Trying 129.114.103.30:443...
* Connected to vdjserver.tapis.io (129.114.103.30) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*  CAfile: /etc/ssl/cert.pem
*  CApath: none
* (304) (OUT), TLS handshake, Client hello (1):
* (304) (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
* ALPN, server accepted to use h2
* Server certificate:
*  subject: C=US; ST=Texas; O=The University of Texas at Austin; CN=*.tapis.io
*  start date: Sep 27 00:00:00 2022 GMT
*  expire date: Sep 27 23:59:59 2023 GMT
*  subjectAltName: host "vdjserver.tapis.io" matched cert's "*.tapis.io"
*  issuer: C=US; ST=MI; L=Ann Arbor; O=Internet2; OU=InCommon; CN=InCommon RSA Server CA
*  SSL certificate verify ok.
* Using HTTP2, server supports multiplexing
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x7fdf4500b600)
> POST /v3/meta/v1airr/query HTTP/2
> Host: vdjserver.tapis.io
> user-agent: curl/7.79.1
> accept: */*
> x-tapis-token: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJqdGkiOiIwZmUwMmE2Zi0xNDNiLTQ5OWQtYTEyOC04YjFkODczNmU0NzUiLCJpc3MiOiJodHRwczovL3ZkanNlcnZlci50YXBpcy5pby92My90b2tlbnMiLCJzdWIiOiJ2ZGpAdmRqc2VydmVyIiwidGFwaXMvdGVuYW50X2lkIjoidmRqc2VydmVyIiwidGFwaXMvdG9rZW5fdHlwZSI6ImFjY2VzcyIsInRhcGlzL2RlbGVnYXRpb24iOmZhbHNlLCJ0YXBpcy9kZWxlZ2F0aW9uX3N1YiI6bnVsbCwidGFwaXMvdXNlcm5hbWUiOiJ2ZGoiLCJ0YXBpcy9hY2NvdW50X3R5cGUiOiJ1c2VyIiwiZXhwIjoxNjY3MDEwMTE0LCJ0YXBpcy9jbGllbnRfaWQiOm51bGwsInRhcGlzL2dyYW50X3R5cGUiOiJwYXNzd29yZCJ9.Ofe5sJYmhWlsyjKiJpXzK2hu3ksM5tCb_N8pMS1ofFnCNO2r30ONkDWQI62Je9jegSe8L87KC8pgedMxbPvjHx0cRizRuPZT7_uEQVhXTJEh7qHESpf1CQXkJVuhUIdaqOWhSE_6-l56QVDUnyB8hreRKgPj2rxPqAS92dkaa56Jjq5Mjc6xiXm7a-l2bDwuKucDe1V7n1_KDwuXl3fNlJaLg0Wfmv13pfFQTZFLxUfJFH4zy2ZpoAN-pNXIv4WKgb0EsLy1OrdpHQvBF-YlbVJsVZMzhT7nqLSmB602zcEgdDkCZCu3wkgdcQ-6F6GO05NNvcydt3WppDAKpOXFew
> content-type: application/json
> content-length: 15
> 
* Connection state changed (MAX_CONCURRENT_STREAMS == 128)!
* We are completely uploaded and fine
< HTTP/2 500 
< server: nginx/1.23.1
< date: Fri, 28 Oct 2022 22:27:04 GMT
< content-type: application/json
< content-length: 161
< strict-transport-security: max-age=63072000
< access-control-allow-origin: *
< access-control-allow-credentials: true
< access-control-allow-methods: GET, POST, PUT, PATCH, DELETE, OPTIONS
< access-control-allow-headers: Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Mx-ReqToken,X-Requested-With,x-tapis-token
< 
* Connection #0 to host vdjserver.tapis.io left intact
{"status":"error","message":"Cannot invoke \"java.util.Map.containsKey(Object)\" because \"this.headers\" is null","result":null,"version":"1.2.0","metadata":{}}
schristley commented 1 year ago

I've discovered this works without error if the document is enclosed within an array. The API doc indicates a single document or an array of documents can be passed, so I guess there is some code that's assuming an array.

$ curl -v -H "X-Tapis-Token: $JWT" -H "Content-type: application/json" --data '[{"test":"test"}]' https://vdjserver.tapis.io/v3/meta/v1airr/query
*   Trying 129.114.103.30:443...
* TCP_NODELAY set
* Connected to vdjserver.tapis.io (129.114.103.30) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
* ALPN, server accepted to use h2
* Server certificate:
*  subject: C=US; ST=Texas; O=The University of Texas at Austin; CN=*.tapis.io
*  start date: Sep 27 00:00:00 2022 GMT
*  expire date: Sep 27 23:59:59 2023 GMT
*  subjectAltName: host "vdjserver.tapis.io" matched cert's "*.tapis.io"
*  issuer: C=US; ST=MI; L=Ann Arbor; O=Internet2; OU=InCommon; CN=InCommon RSA Server CA
*  SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x563017085e30)
> POST /v3/meta/v1airr/query HTTP/2
> Host: vdjserver.tapis.io
> user-agent: curl/7.68.0
> accept: */*
> x-tapis-token: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJqdGkiOiJmMjM0NzFjOS02NjYxLTRlZWEtYTY1Zi1iOGRiZjhlZTFhYTUiLCJpc3MiOiJodHRwczovL3ZkanNlcnZlci50YXBpcy5pby92My90b2tlbnMiLCJzdWIiOiJ2ZGpAdmRqc2VydmVyIiwidGFwaXMvdGVuYW50X2lkIjoidmRqc2VydmVyIiwidGFwaXMvdG9rZW5fdHlwZSI6ImFjY2VzcyIsInRhcGlzL2RlbGVnYXRpb24iOmZhbHNlLCJ0YXBpcy9kZWxlZ2F0aW9uX3N1YiI6bnVsbCwidGFwaXMvdXNlcm5hbWUiOiJ2ZGoiLCJ0YXBpcy9hY2NvdW50X3R5cGUiOiJ1c2VyIiwiZXhwIjoxNjcwMzY4Mzc5LCJ0YXBpcy9jbGllbnRfaWQiOm51bGwsInRhcGlzL2dyYW50X3R5cGUiOiJwYXNzd29yZCJ9.bW4GIe5WKRpdj6bu6hJoFOXQet9M0kRSwF7WAldTWoLWZOS5NpJ955u_OU3-k2_clbKdX5K-ibEQowxH7wBjJOOPoNjNKbjzPH95oMjJgTzNt2B_PjMUMtNDiqjNKPczz5AlYVnxnUuBf3DJtmjQEqn5rlCQRZVbY1nBr0jITuQ-LXe2eamBzQ8Lm_km8LqxfWJYHomAS-I55TbOUJu5Cu5srBWtjX-XfoKKa_IV3-T5elB4wPx0tHVrEhXXwVurSzouc6MsXu8JLkfoDhDyC7kn5Mu5V_f7F80e0ll4Xb0ZlJrQs8bMaZ-Gl1jCZhimDGEYAVzr5PA_DI5EFevnog
> content-type: application/json
> content-length: 17
> 
* Connection state changed (MAX_CONCURRENT_STREAMS == 128)!
* We are completely uploaded and fine
< HTTP/2 200 
< server: nginx/1.23.2
< date: Tue, 06 Dec 2022 19:13:55 GMT
< content-type: application/json
< content-length: 126
< location: https://admin.tapis.io
< etag: "638f94733589297f9c00ab43"
< strict-transport-security: max-age=63072000
< access-control-allow-origin: *
< access-control-allow-credentials: true
< access-control-allow-methods: GET, POST, PUT, PATCH, DELETE, OPTIONS
< access-control-allow-headers: Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Mx-ReqToken,X-Requested-With,x-tapis-token
< 
* Connection #0 to host vdjserver.tapis.io left intact
{"inserted":1,"deleted":0,"modified":0,"matched":0,"_links":{"rh:newdoc":[{"href":"/v1airr/query/638f94733589297f9c00ab44"}]}}
schristley commented 1 year ago

moved issue to meta repositroy