Bug Description
When we bring up the Docker stack in the Docker compose file locally by following the linked documentation and make an API POST request as follows:
The request from the Documentation is as follows:
# Submit a workflow in XML format for execution
xmlFile <- "pecan/tests/api.sipnet.xml"
xml_string <- paste0(xml2::read_xml(xmlFile))
res <- httr::POST(
"http://pecan.localhost/api/workflows/",
httr::authenticate("carya", "illinois"),
httr::content_type("application/xml"),
body = xml_string
)
print(jsonlite::fromJSON(rawToChar(res$content)))
We encounter the following error:
$error
[1] "500 - Internal server error"
$message
[1] "Error: $ operator is invalid for atomic vectors\n"
Upon further inspection in the API container in Docker Desktop, we can see the logs as below:
2023-06-27 17:14:54
2023-06-27 17:14:54 Attaching package: ‘dplyr’
2023-06-27 17:14:54
2023-06-27 17:14:54 The following objects are masked from ‘package:stats’:
2023-06-27 17:14:54
2023-06-27 17:14:54 filter, lag
2023-06-27 17:14:54
2023-06-27 17:14:54 The following objects are masked from ‘package:base’:
2023-06-27 17:14:54
2023-06-27 17:14:54 intersect, setdiff, setequal, union
2023-06-27 17:14:54
2023-06-27 17:14:56 Running plumber API at http://0.0.0.0:8000
2023-06-27 17:14:56 Running swagger Docs at http://127.0.0.1:8000/__docs__/
2023-06-27 17:19:23 2023-06-27 11:49:23 DEBUG [insert.workflow] :
2023-06-27 17:19:23 INSERT INTO workflows (site_id, model_id, folder, hostname, start_date,
2023-06-27 17:19:23 end_date, advanced_edit, started_at) VALUES ($1, $2, $3, $4, $5, $6, $7,
2023-06-27 17:19:23 $8) RETURNING id
2023-06-27 17:19:24 2023-06-27 11:49:24 DEBUG [insert.workflow] :
2023-06-27 17:19:24 Running workflow ID: 99000000087
2023-06-27 17:19:25 Warning in result_fetch(res@ptr, n = n) :
2023-06-27 17:19:25 Don't need to call dbFetch() for statements, only for queries
2023-06-27 17:19:25 2023-06-27 11:49:25 INFO [rabbitmq_create_queue] :
2023-06-27 17:19:25 creating queue pecan in rabbitmq
2023-06-27 17:19:25 2023-06-27 11:49:25 ERROR [rabbitmq_send_message] :
2023-06-27 17:19:25 error sending message to rabbitmq [ 405 ]
2023-06-27 17:19:25 <simpleError: $ operator is invalid for atomic vectors>
The api.sipnet.xml file is as follows:
<?xml version="1.0"?>
<pecan>
<pfts>
<pft>
<name>temperate.coniferous</name>
</pft>
</pfts>
<meta.analysis>
<iter>3000</iter>
<random.effects>FALSE</random.effects>
<threshold>1.2</threshold>
<update>AUTO</update>
</meta.analysis>
<ensemble>
<variable>NPP</variable>
</ensemble>
<sensitivity.analysis>
<quantiles>
<sigma>-1</sigma>
<sigma>1</sigma>
</quantiles>
<variable>NPP</variable>
</sensitivity.analysis>
<model>
<type>SIPNET</type>
<revision>r136</revision>
<id>1000000014</id>
</model>
<run>
<site>
<id>772</id>
</site>
<inputs>
<met>
<id>99000000003</id>
</met>
</inputs>
<start.date>2002-01-01 00:00:00</start.date>
<end.date>2005-12-31 00:00:00</end.date>
<dbfiles>pecan/dbfiles</dbfiles>
</run>
</pecan>
Upon further inspection, even if we use the csv file in the Pecan-Status-Board repository, we encounter the same error.
Expected behavior
The workflow should be successfully submitted and tests should be performed against the given data
/assign @robkooper