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

db_create() / Error reading from the connection #20

Open
bioxenia opened this issue Apr 25, 2021 · 4 comments
Open

db_create() / Error reading from the connection #20

bioxenia opened this issue Apr 25, 2021 · 4 comments

Comments

@bioxenia
Copy link

bioxenia commented Apr 25, 2021

Hello again.
I am trying to run the restez package. I tried that on Windows10 but I got UTF-8 errors, so I installed a different OS, Ubuntu specifically, via Vitrual Box. But now an other error occured.
I am trying to download the invertebrate data, and after making the connection and running the db_create command I get the error:

Error in readLines(con = connection) : error reading from the connection In addition: Warning message: In readLines(con = connection) : invalid or incomplete compressed data Error: callr subprocess failed: error reading from the connection
Do you have any ideas?
Thank you!

@jeroen
Copy link
Member

jeroen commented Apr 28, 2021

You need to be more specific about what code you ran, and the context of the error. Both on Windows and Ubuntu. From your error message above it is impossible to guess what went wrong.

Did you install the latest version of restez?

@bioxenia
Copy link
Author

bioxenia commented Apr 29, 2021

Yes, I have the latest version of restez.
The code I ran and the error I get on Windows:

`

library(restez)
rstz_pth <- file.path(tempdir(), 'database')
if (!dir.exists(rstz_pth)) {
dir.create(rstz_pth)
}
restez_path_set(filepath = rstz_pth)
db_download()
restez_connect()
db_create()
Adding 204 file(s) to the database ...
... 'gbinv1.seq.gz' (1/204)
... 'gbinv10.seq.gz' (2/204)
... 'gbinv100.seq.gz' (3/204)
... 'gbinv101.seq.gz' (4/204)
... 'gbinv102.seq.gz' (5/204)
... 'gbinv103.seq.gz' (6/204)
: Invalid argument
Error in gsub("\n", " ", res, fixed = TRUE) :
input string 1 is invalid UTF-8
Error: callr subprocess failed: input string 1 is invalid UTF-8
Type .Last.error.trace to see where the error occured
.Last.error.trace

Stack trace:

Process 11096:

  1. restez:::db_create()
  2. restez:::gb_build2(dpth = dpth, seq_files = seq_files, max_length = max_length, ...
  3. callr::r(func = function(restez_path, gb_build, dpth, seq_files, ...
  4. callr:::get_result(output = out, options)
  5. throw(newerr, parent = remerr[[2]])

x callr subprocess failed: input string 1 is invalid UTF-8

Process 11636:
17. (function (restez_path, gb_build, dpth, seq_files, max_length, ...
18. restez:::gb_build(dpth = dpth, seq_files = seq_files, max_length = max_length, ...
19. restez:::gb_sql_add(df = df)
20. DBI::dbWriteTable(conn = connection, name = "nucleotide", value = df, ...
21. DBI::dbWriteTable(conn = connection, name = "nucleotide", value = df, ...
22. MonetDBLite:::.local(conn, name, value, ...)
23. DBI:::dbCommit(conn)
24. MonetDBLite:::dbCommit(conn)
25. DBI:::dbSendQuery(conn, "COMMIT")
26. MonetDBLite:::dbSendQuery(conn, "COMMIT")
27. MonetDBLite:::.local(conn, statement, ...)
28. MonetDBLite:::monetdb_embedded_query(conn@connenv$conn, statement, ...
29. base:::gsub("\n", " ", res, fixed = TRUE)
30. base:::.handleSimpleError(function (e) ...
31. h(simpleError(msg, call))

x input string 1 is invalid UTF-8
`

and these are on Ubuntu:

`

db_create()
Adding 204 file(s) to the database ...
... 'gbinv1.seq.gz' (1/204)
... 'gbinv10.seq.gz' (2/204)
... 'gbinv100.seq.gz' (3/204)
Error in readLines(con = connection) : error reading from the connection
In addition: Warning message:
In readLines(con = connection) : invalid or incomplete compressed data
Error: callr subprocess failed: error reading from the connection
Type .Last.error.trace to see where the error occurred
Last.error.trace
Error: object 'Last.error.trace' not found
.Last.error.trace

Stack trace:

Process 13829:

  1. restez:::db_create()
  2. restez:::gb_build2(dpth = dpth, seq_files = seq_files, max_length ...
  3. callr::r(func = function(restez_path, gb_build, dpth, seq_files, ...
  4. callr:::get_result(output = out, options)
  5. throw(newerr, parent = remerr[[2]])

x callr subprocess failed: error reading from the connection

Process 22214:
17. (function (restez_path, gb_build, dpth, seq_files, max_length, ...
18. restez:::gb_build(dpth = dpth, seq_files = seq_files, max_length = max_leng ...
19. restez:::flatfile_read(flpth = flpth)
20. base:::readLines(con = connection)
21. base:::.handleSimpleError(function (e) ...
22. h(simpleError(msg, call))

x error reading from the connection
`
Thank you for your help!

@maelle

This comment was marked as outdated.

@joelnitta
Copy link
Contributor

joelnitta commented Jul 7, 2022

I am the new maintainer.

The OP didn't mention it, but it looks like they selected 'Invertebrate' to download (as of GenBank release 250, this is 715 files and 62.6 GB in compressed, downloaded files).

I will try running the code with the current version of restez, but the download is quite large so it may take some time.

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

4 participants