AnsweredAssumed Answered

Transaction didn't commit: Failed to open stream onto channe

Question asked by orived on Mar 1, 2008
Latest reply on Aug 26, 2009 by sameer1sharma
hi all,

Antecedents:
Alfresco community working since 1 month in an intel HP-ML110 + centos 5.1.
4GB of files imported via CIFS. 2 weeks ago we migrate without problems our working alfresco to a new system with:
Hardware:
IBM's pseries (openpower,
2way POWER5 1.6 CPU and 5GB RAM, virtualized fedora core8-ppc with 1 processor an 2GB RAM assigned to the v-machine)
Software:
ibm-java2-ppc64-sdk-5.0-6.0 from IBM. Fresh alfresco-community-tomcat-2.1.0.tar.gz
Content:
syncronized alf_data and mysql from old server:

root@192.168.0.2# rsync -avopz -e 'ssh' /opt/alfresco/alf_data/ root@192.168.0.9:/opt/alfresco
root@192.168.0.2# mysqldump -pverysecretpass alfresco | mysql -h 192.168.0.9 alfresco -pmoresecretpass

2 days ago alfresco does not permits to delete a folder inmediatelly after its creation. After that, we try to restart alfresco but gives an error similar to the one in http://forums.alfresco.com/viewtopic.php?p=23783#23783 refusing to start after trying to reindex. In tomcat/logs/catalina.out:
00:25:47,195 ERROR [org.springframework.web.context.ContextLoader] Context initialization failed
org.alfresco.error.AlfrescoRuntimeException: Unknown Exception in Transaction.
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:292)


Caused by:
javax.transaction.RollbackException: Transaction didn't commit: Failed to open stream onto channel:
   accessor: ContentAccessor[ contentUrl=store://2008/2/29/0/25/7c8ed92c-e654-11dc-9999-db5cb0c5ee62.bin, mimetype=null, size=0, encoding=UTF-8, locale=es_ES]


Caused by:
org.alfresco.service.cmr.repository.ContentIOException: Failed to open stream onto channel:
   accessor: ContentAccessor[ contentUrl=store://2008/2/29/0/25/7c8ed92c-e654-11dc-9999-db5cb0c5ee62.bin, mimetype=null, size=0, encoding=UTF-8, locale=es_ES]


Caused by:
java.lang.UnsupportedOperationException: The content never exists  

00:25:47,200 ERROR [org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/alfresco]] Excepción enviando evento inicializado de contexto a instancia de escuchador de clase org.springframework.web.context.ContextLoaderListener

Caused by:
javax.transaction.RollbackException: Transaction didn't commit: Failed to open stream onto channel:
   accessor: ContentAccessor[ contentUrl=store://2008/2/29/0/25/7c8ed92c-e654-11dc-9999-db5cb0c5ee62.bin, mimetype=n

Caused by:
org.alfresco.service.cmr.repository.ContentIOException: Failed to open stream onto channel:
   accessor: ContentAccessor[ contentUrl=store://2008/2/29/0/25/7c8ed92c-e654-11dc-9999-db5cb0c5ee62.bin, mimetype=n

Caused by:
java.lang.UnsupportedOperationException: The content never exists
        at org.alfresco.repo.content.AbstractContentReader.getContentInputStream(AbstractContentReader.java:337)
        at org.alfresco.repo.search.impl.lucene.ADMLuceneIndexerImpl.indexProperty(ADMLuceneIndexerImpl.java:858)
    

node *9999-db5cb0c5ee62.bin does not exists in filesystem (alf_data/contentstore) nor in table in alf_node nor in table alf_node_properties  nor in table alf_node_status but exists in the last record of alf_transaction

mysql> select * from alf_transaction order by id desc limit 1;
+——-+———+———–+————————————–+
| id    | version | server_id | change_txn_id                        |
+——-+———+———–+————————————–+
| 20746 |       0 |         3 | fa12fcaa-e651-11dc-9999-db5cb0c5ee62 |
+——-+———+———–+————————————–+

touching /opt/alfresco/alf_data/contentstore/2008/2/29/0/25/7c8ed92c-e654-11dc-9999-db5cb0c5ee62.bin
does not solve the problem, alfresco does not start and the problematic file is a new one with the date
and time equal to the actual date and time. With
log4j.logger.org.alfresco.repo.content.transform=DEBUG
in tomcat/webapps/alfresco/WEB-INF/classes/log4j.properties, we can determine that the origin of the problem is a failed transformation operation over a mail file in the repository every time we try to start alfresco:



18:29:14,497 DEBUG [org.alfresco.repo.content.transform.ContentTransformerRegistry] Searched for transformer:
   source mimetype: message/rfc822
   target mimetype: text/plain
   transformers: [MailContentTransformer[ average=0ms]]
18:29:14,580 WARN  [org.alfresco.repo.content.transform.MailContentTransformer] Unable to extract meta-data from message: Invalid header signature; read 281480939782985, expected -2226271756974174256
18:29:14,580 DEBUG [org.alfresco.repo.content.transform.AbstractContentTransformer] Completed transformation:
   reader: ContentAccessor[ contentUrl=store://2008/1/29/14/6/f25eb3d1-ce6a-11dc-920b-3783dabd67ea.bin, mimetype=message/rfc822, size=14212, encoding=UTF-8, locale=es_ES]
   writer: ContentAccessor[ contentUrl=store://2008/2/29/18/29/d8e6a806-e6eb-11dc-964a-9b058606fdd8.bin, mimetype=text/plain, size=0, encoding=UTF-8, locale=es_ES]
   options: {}
   transformer: MailContentTransformer[ average=4ms]
18:29:15,797 ERROR [org.springframework.web.context.ContextLoader] Context initialization failed
org.alfresco.error.AlfrescoRuntimeException: Unknown Exception in Transaction.


Caused by:
javax.transaction.RollbackException: Transaction didn't commit: Failed to open stream onto channel:
   accessor: ContentAccessor[ contentUrl=store://2008/2/29/18/29/d8e6a806-e6eb-11dc-964a-9b058606fdd8.bin, mimetype=null, size=0, encoding=UTF-8, locale=es_ES]
        at org.alfresco.util.transaction.SpringAwareUserTransaction.commit(SpringAwareUserTransaction.java:430)
Eliminating the file does not eliminate the problem, there are several message/rfc822 files and all of them break the initialization of alfresco. Really, the files identified like rfc822 are binary files incorrectly identificated by alfresco (we can provide one of them to alfresco's engineers to study if needed), then the conversion fails for that.

partial solution:
system.bootstrap.config_check.strict=false does not solve the problem.

comenting out
<!–   <bean id="extracter.Mail" class="org.alfresco.repo.content.metadata.MailMetadataExtracter" parent="baseMetadataExtracter" /> –>
and
<!–
   <bean id="transformer.OutlookMsg"
         class="org.alfresco.repo.content.transform.MailContentTransformer"
         parent="baseContentTransformer" />
–>
in tomcat/webapps/alfresco/WEB-INF/classes/alfresco/content-services-context.xml eliminates the error and permits alfresco to start.

Outcomes