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

Loading unicode text file for FASTQ names fails #41

Open
jdeck88 opened this issue Aug 13, 2020 · 0 comments
Open

Loading unicode text file for FASTQ names fails #41

jdeck88 opened this issue Aug 13, 2020 · 0 comments

Comments

@jdeck88
Copy link
Member

jdeck88 commented Aug 13, 2020

In the FASTQ loader, if the filetype is unicode then the loader fails, e.g.:

sample.txt

>file sample.txt
sample: Little-endian UTF-16 Unicode text, with CRLF line terminators

As a work-around, run the following command to convert to ascii (tested on Mac OS, should work on any linux):

>iconv -f UTF-16 -t ASCII//TRANSLIT//IGNORE 1904_MS_fastq_files.txt > 1904_MS_fastq_files.ascii.txt

The following is the system error that is generated.... this needs to be fixed (or at least tell the user to convert their file to ASCII).

 ERROR: invalid byte sequence for encoding "UTF8": 0x00; nested exception is org.postgresql.util.PSQLException: ERROR: invalid byte sequence for encoding "UTF8": 0x00
	at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:102)
	at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73)
	at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:82)
	at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:82)
	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:655)
	at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:690)
	at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:717)
	at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:767)
	at org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate.query(NamedParameterJdbcTemplate.java:192)
	at org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate.query(NamedParameterJdbcTemplate.java:199)
	at biocode.fims.fastq.PostgresFastqRepository.getRecords(PostgresFastqRepository.java:36)
	at jdk.internal.reflect.GeneratedMethodAccessor2300.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
	at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282)
	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
	at com.sun.proxy.$Proxy1156.getRecords(Unknown Source)
	at biocode.fims.fastq.reader.FastqConverter.getExistingRecords(FastqConverter.java:164)
	at biocode.fims.fastq.reader.FastqConverter.convertRecordSet(FastqConverter.java:65)
	at biocode.fims.run.DatasetBuilder.runDataConverters(DatasetBuilder.java:400)
	at biocode.fims.run.DatasetBuilder.build(DatasetBuilder.java:131)
	at biocode.fims.run.DatasetProcessor.validate(DatasetProcessor.java:101)
	at biocode.fims.rest.services.DatasetController.lambda$validate$0(DatasetController.java:220)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
	... 1 more
Caused by: org.postgresql.util.PSQLException: ERROR: invalid byte sequence for encoding "UTF8": 0x00
	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2422)
	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2167)
	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:306)
	at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441)
	at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365)
	at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:155)
	at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:118)
	at org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:698)
	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:639)
	... 26 more
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