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

kobo_df_download failing when running the.RProj on a Windows machine #22

Open
TheDataAreClean opened this issue Oct 28, 2024 · 7 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@TheDataAreClean
Copy link

Hello, I have this code that I have been running for the last year, where the on-field collected data is downloaded from a particular Kobo form and analysed.

Recently, I was handing over the code to my team members, who run a Windows machine. The code has been failing on their system fairly often.

The Original Environment

  • .Rproj running on an Intel Macbook Pro
  • All file paths and credentials are non-static
  • Witnessed no failures on the code till date

The Code Chunk

data_from_field <- 
  kobo_df_download(
    url = "kf.kobotoolbox.org",
    uname = USER_ID,
    pwd = PASSWORD,
    assetid = id_data_from_field,
    lang = "_xml",
    sleep = 5
  )

The Error

> Waiting.. 15 seconds 
> Export instruction sent successfully. Waiting for result. 
> [[1]]
> NULL
> 
> [[2]]
> [1] "some_id_different_from_assetid"
> 
> Error:  `url` must be a single string, not `NULL`. 
> Error during export download:  object 'dff' not found 
> Export download was not successful; skipping deletion.
> 

The failure happens some times, some times it runs with issues. Highly inconsistent.

Things I have tried

  • Complete re-download the .Rproj
  • Clearing the entire workspace to avoid and cache, etc.
  • Running to code on multiple Windows machines; failing on all of them

You can also find the entire codebase here: https://github.com/udhyam/food/

Any help to resolve this is appreciated! Thank you! :)

@TheDataAreClean TheDataAreClean changed the title kobo_df_download failing when running. the.RProj on a Windows machine kobo_df_download failing when running the.RProj on a Windows machine Oct 28, 2024
@asitav-sen
Copy link
Owner

Hi Arpit.
Thanks. I could replicate the error in Mac as well. Investigation revealed that this is an issue with Kobotoolbox server.
I created exports whose status is processing since long time.
image

@asitav-sen
Copy link
Owner

Update: I have created a ticket in Kobotoolbox forum seeking help in understanding the issue.

@TheDataAreClean Can you follow this documentation to check if you can retrieve data using postman? If yes, can you please let me know?

KoboToolbox Form Building API.pdf

@asitav-sen asitav-sen added bug Something isn't working help wanted Extra attention is needed labels Oct 28, 2024
@asitav-sen asitav-sen pinned this issue Oct 28, 2024
@TheDataAreClean
Copy link
Author

TheDataAreClean commented Oct 29, 2024

Thanks, @asitav-sen ! I am not super familiar with Postman, let me try it and get back to you.

Important Side Note: The code run started failing on my system too today morning.

Downloading: 7 kB     Export instruction sent successfully. Waiting for result. 
Downloading: 7 kB     Error in if (post_export$results$status[post_count] == "error") { : 
  missing value where TRUE/FALSE needed

@asitav-sen
Copy link
Owner

@TheDataAreClean Looks like it is working now. I didn't change anything.

@joe-epidemio
Copy link

Hi @asitav-sen I'm having the same issue now as well, but it seems my error might also be linked to my Kobo form being in .xlsx format? Is there a way to ensure it is read in as a csv and get the download to work with the server?

@asitav-sen
Copy link
Owner

@joe-epidemio I will soon update the package.

@asitav-sen asitav-sen self-assigned this Nov 21, 2024
@andresimi
Copy link

Hi Guys, I am facing the same problem.
I am using KoboconnectR version 2.0.0 in R version 4.4.2 from the Github. I am also using Fedora 41 silverblue as a system.
Could you manage the problem? Best!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants