Skip to content

Uploading fails when results.zip is missing for CM/SCCS #263

@anthonysena

Description

@anthonysena

CohortMethod & SelfControlledCaseSeries produce a Results*.zip file at the end of execution which then required when uploading results. These modules currently have some code that attempts to create a Results.zip if one is not present since the CM/SCCS upload methods require this as input:

# TODO: This is something CM does differently.
# Find the results zip file in the results sub folder
resultsFolder <- private$jobContext$moduleExecutionSettings$resultsSubFolder
zipFiles <- list.files(
path = resultsFolder,
pattern = "\\.zip$",
full.names = TRUE
)
if (length(zipFiles) > 0) {
zipFileName <- zipFiles[1]
} else {
# Create a zip file from the results in the directory
DatabaseConnector::createZipFile(
zipFile = "results.zip",
files = list.files(resultsFolder, pattern = ".*\\.csv$"),
rootFolder = resultsFolder
)
zipFileName <- file.path(resultsFolder, "results.zip")
}
# TODO: This function does not expose
# a way to specify the database identifier file
# which makes the purge problematic since I'm
# not sure how it will know what to purge...
CohortMethod::uploadResults(
connectionDetails = resultsConnectionDetails,
schema = resultsDataModelSettings$resultsDatabaseSchema,
zipFileName = zipFileName,
purgeSiteDataBeforeUploading = FALSE
)
},

Specifically, "results.zip" gets written to the current directory (getwd()) while CohortMethod then tries to read it from resultsFolder which is a bug.

A separate, but related issue: should CM/SCCS produce a .zip file as part of execution that is then required for upload when running through Strategus?

Tagging @msuchard (thanks for reporting this) and @schuemie

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions