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

Error when trying to upload folders : lexical error: invalid char in json text #139

Open
MorHeene opened this issue Mar 16, 2022 · 1 comment

Comments

@MorHeene
Copy link

MorHeene commented Mar 16, 2022

When trying to upload a folder containing several subfolders I keep getting the following error, even after updating to the latest version:

Code:

cr_project <- osf_retrieve_node("MyOSFprojectNode")
osf_ls_files(cr_project, type = "folder")
target_dir <- osf_ls_files(cr_project, path = "Output", pattern = "FolderNameOnOSF")  # Define the target directory: Selecting the "FolderNameOnOSF" subdirectory within top-level "Output" directory.
osf_upload(target_dir, path = ".", recurse = TRUE, conflicts = "overwrite", verbose = TRUE) 

Error message:

Uploading 577 new file(s) to OSF
Error: lexical error: invalid char in json text.
                                       Cannot complete action: file or
                     (right here) ------^ 

Using osfr to upload those folders definitely worked a couple of months ago. No clue what might have changed.

@MorHeene
Copy link
Author

Just in case someone else runs into the same problem: Seems that I found out what caused the problem: The various subfolders contained hidden .RData files. After deleting them, all sub-folders and their content were successfully uploaded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant