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

POST Text Timeseries #931

Open
krowvin opened this issue Oct 24, 2024 · 2 comments
Open

POST Text Timeseries #931

krowvin opened this issue Oct 24, 2024 · 2 comments

Comments

@krowvin
Copy link
Collaborator

krowvin commented Oct 24, 2024

Attempting to POST to text-timeseries I get an error about Timewindow containing no times on interval.
I have tried using the test timestamps/payload here as well:
https://github.com/USACE/cwms-data-api/blob/develop/cwms-data-api/src/test/resources/cwms/cda/api/spk/text_ts_create_reg.json
Same error.

Not sure what I am missing here!

Attempted payload on 3.1.5RC15

{
  "office-id": "SWT",
  "name": "KEYS.Flow.Inst.1Hour.0.Text-Timeseries",
  
  "version-date": "2024-10-24T14:00:00Z",
  "regular-text-values": [
    {
      "date-time": "2024-10-24T14:00:00Z",
      "data-entry-date": "2024-10-24T14:00:00Z",
      "text-value": "{\"test\": \"Hurrah!\"}",
      "media-type": "application/json"
    }
  ]
}

I get the following error

ORA-06512: at "CWMS_20.CWMS_TEXT", line 2203
ORA-06512: at "CWMS_20.CWMS_ERR", line 80
ORA-06512: at "CWMS_20.CWMS_TS", line 10919
ORA-06512: at "CWMS_20.CWMS_TS", line 10979
ORA-06512: at "CWMS_20.CWMS_TEXT", line 2187
ORA-06512: at "CWMS_20.CWMS_TEXT", line 2674
ORA-06512: at line 1

                at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:509)
                at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:461)
                at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:1104)
                at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:550)
                at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:268)
                at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:655)
                at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:265)
                at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:86)
                at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:965)
                at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1205)
                at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3666)
                at oracle.jdbc.driver.T4CCallableStatement.executeInternal(T4CCallableStatement.java:1358)
                at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3778)
                at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4251)
                at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1081)
                at sun.reflect.GeneratedMethodAccessor322.invoke(Unknown Source)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                at java.lang.reflect.Method.invoke(Method.java:498)
                at org.apache.tomcat.jdbc.pool.StatementFacade$StatementProxy.invoke(StatementFacade.java:118)
                at com.sun.proxy.$Proxy238.execute(Unknown Source)
                at org.jooq.tools.jdbc.DefaultPreparedStatement.execute(DefaultPreparedStatement.java:219)
                at org.jooq.impl.Tools.executeStatementAndGetFirstResultSet(Tools.java:4695)
                at org.jooq.impl.AbstractRoutine.execute0(AbstractRoutine.java:622)
                at org.jooq.impl.AbstractRoutine.executeCallableStatement(AbstractRoutine.java:582)
                ... 69 more
        Caused by: Error : 20998, Position : 0, Sql = BEGIN "CWMS_20"."CWMS_TEXT"."STORE_TS_TEXT" (:1 , :2 , :3 , cast(:4  as date), :5 , :6 , :7 , :8 , :9 ) ; END;, OriginalSql = { call "CWMS_20"."CWMS_TEXT"."STORE_TS_TEXT" (?, ?, ?, cast(? as date), ?, ?, ?, ?, ?) }, Error Msg = ORA-20998: ERROR: Time window contains no times on interval.
ORA-06512: at "CWMS_20.CWMS_TEXT", line 2203
ORA-06512: at "CWMS_20.CWMS_ERR", line 80
ORA-06512: at "CWMS_20.CWMS_TS", line 10919
ORA-06512: at "CWMS_20.CWMS_TS", line 10979
ORA-06512: at "CWMS_20.CWMS_TEXT", line 2187
ORA-06512: at "CWMS_20.CWMS_TEXT", line 2674
ORA-06512: at line 1

                at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:513)
                ... 92 more

CURL:

curl -X 'POST' \
  'https://T7-HOST/swt-data/timeseries/text?replace-all=true' \
  -H 'accept: */*' \
  -H 'Content-Type: application/json;version=2' \
  -d '{
  "office-id": "SWT",
  "name": "KEYS.Flow.Inst.1Hour.0.Text-Timeseries",
  
  "version-date": "2024-10-24T14:00:00Z",
  "regular-text-values": [
    {
      "date-time": "2024-10-24T14:00:00Z",
      "data-entry-date": "2024-10-24T14:00:00Z",
      "text-value": "{\"test\": \"Hurrah!\"}",
      "media-type": "application/json"
    }
  ]
}
'
@krowvin
Copy link
Collaborator Author

krowvin commented Oct 24, 2024

it seems the timeseries was created but is empty

curl -X 'GET' \
  'https://T7-HOST/swt-data/timeseries/text?office=SWT&name=KEYS.Flow.Inst.1Hour.0.Text-Timeseries&begin=2024-10-01T00%3A00%3A00&end=2024-10-24T14%3A00%3A00' \
  -H 'accept: application/json;version=2'

@inguyen314 is also actively trying to use this Method/Endpoint as well

@MikeNeilson
Copy link
Contributor

Only difference I see is the ISO 8601 vs epoch milliseconds.
You use https://www.epochconverter.com/ to help convert between the two.

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

2 participants