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

redmine_users() throws error #6

Open
WurmPeter opened this issue Feb 2, 2023 · 5 comments
Open

redmine_users() throws error #6

WurmPeter opened this issue Feb 2, 2023 · 5 comments

Comments

@WurmPeter
Copy link

Hello,

I found this great package today, thanks :) Is it still maintained?

We are running a local redmine installation in version 5.0.3.stable. When I run redmineR::redmine_users() I get this error:

[17:17:01] ERROR h() replacement element 9 has 38 rows, need 42
Error in `[<-.data.frame`(`*tmp*`, atomicCols, value = list(id = c(33L,  : 
  replacement element 9 has 38 rows, need 42
@mnazarov
Copy link
Member

mnazarov commented Feb 7, 2023

Hello,
I would say it is in a 'sleeping' state, but nevertheless we can try to help.
Unfortunately I can't reproduce the error you are getting, it appears to be happening at the moment of merging together response data from the users. Do you happen to have custom fields for users?

If you are comfortable with debugging, I suggest you run

debugonce(redmineR:::redmine_get_all_pages)
redmineR::redmine_users()

and then follow the code line be line - from the error message it appears to fail at the line res_df[atomicCols] <- lapply(res_df[atomicCols], unlist) - so hopefully you would see what exactly is failing.
If you could then share your findings, we will use that to improve the package.

@WurmPeter
Copy link
Author

WurmPeter commented Feb 8, 2023

Hello,

Thanks for trying to help. I think I have successfully debugged this problem.
First, we do not use custom fields for users.

So by debugging I stopped at this line res_df[atomicCols] <- lapply(res_df[atomicCols], unlist) and noticed that some rows have NULLs in column "last_login_on". So I manually set them to "2021-04-20T13:12:51Z" and then it worked.

So that line should be changed to handle NULLs well. Are you able to fix that? Maybe going through all cells and replace NULLs with NAs (seem to be fine) before that step via res_df <- res_df %>% dplyr::replace(.=="NULL", NA)?

EDIT: Had the same issue with redmineR::redmine_custom_fields() and redmineR::redmine_issues(assigned_to_id = 17) and replacing the NULLs as described above worked there, too.

@mnazarov
Copy link
Member

Thanks for debugging. I would appreciate if you could share (a part of) your data in res_df to understand it better. Are the NULLs that you mention actually string "NULL"s (as in your replace call) or actual NULLs?

@WurmPeter
Copy link
Author

WurmPeter commented Feb 10, 2023

I don't know what is the best way to share that data.

I can tell you that in RStudio in the environment it shows NULL, not "NULL": redmineR_bug_environment
(I had to black out sensitive information)

(btw: It seems that the NULLs in column "twofa_scheme" do no harm - maybe because all rows contain NULL?)

@WurmPeter
Copy link
Author

Hello,

Do you think this is a bad solution?

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

2 participants