Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Error moving stage file in an AWS file target #1103

@wlandau

Description

@wlandau

Discussed in #1102

Originally posted by jds485 August 9, 2023

Help

Description

I recently updated from targets 0.11.0 to the latest version, 1.2.0. With that update, I am unable to tar_load() any file target that is stored on AWS S3. This happens for targets that were generated with 0.11.0 or new targets made with 1.2.0. I also tried with targets version 0.14.3 and had the same issue. I am not sure if this is a targets issue, but I saw a similar error message in #410 and wanted to check in.

A simple repex is to create a file target with targets version 0.14.3 or 1.2.0 and try to tar_load() the file target:

  tar_target(
    test_aws_file,
    {
      write.csv(data.frame(a=1), 'test.csv')
      'test.csv'
    },
    format = "file",
    repository = "aws"
  ),
  tar_target(
    test_aws_file_depend,
    read.csv(test_aws_file),
    format = "file",
    repository = "aws"
  )
tar_make(test_aws_file) #works and the file is showing in the S3 bucket
tar_load(test_aws_file) #warning message and file doesn’t appear in my directory
tar_make(test_aws_file_depend) #fails with error message below because the file does not load from S3

For me, that results in this warning for the tar_load(test_aws_file)

Warning message:
In file.rename(from = scratch, to = stage) :
  cannot rename file '/tmp/RtmpKQBTDI/scratch/targets_aws_file_1446a6e99e5' to 'test.csv', reason 'Invalid cross-device link'

And this error message for tar_make(test_aws_file_depend)

"cannot open file test.csv No such file or directory"
Error:
! Error running targets::tar_make()
  Error messages: targets::tar_meta(fields = error, complete_only = TRUE)
  Debugging guide: https://books.ropensci.org/targets/debugging.html
  How to ask for help: https://books.ropensci.org/targets/help.html
  Last error: cannot open the connection

This is being run in R version 4.1.3.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions