'AssertionError' when uploading image to Plone5 site

Hello,

An 'AssertionError' message appears when I try to upload an image to my Plone5 web site on a private virtual server (PVS) with Ubuntu 16.04. In French (my native language), the message says: "Nous sommes désolés mais il semble qu'il y ait une erreur..." (transl.: We are sorry, but it seems there is a mistake). A complete traceback of the error message follows, the beginning of which I am giving here with some translation in English (my apologies for its length but, unless I missed it, I didn't find any way to add an attachment to my message):

/***

Heure (Time)
02/06/2018 20:40
Identifiant (User name)
admin (admin)
URL de la requête (URL of the query)
http://modular6.net:8080/ArcheoNavis9/modelisme/la-fregate-la-legere/++add++Image
Type d'erreur (Type oof error)
AssertionError
Valeur de l'erreur (Value of the error)

Traceback (innermost last):

Module ZPublisher.Publish, line 146, in publish
Module Zope2.App.startup, line 303, in commit
Module transaction._manager, line 131, in commit
Module transaction._transaction, line 310, in commit
Module transaction._transaction, line 301, in commit
Module transaction._transaction, line 446, in _commitResources
Module transaction._transaction, line 420, in _commitResources
Module ZODB.Connection, line 498, in commit
Module ZODB.Connection, line 547, in _commit
Module ZODB.Connection, line 596, in _store_objects
Module ZODB.mvccadapter, line 170, in storeBlob
Module ZODB.blob, line 730, in storeBlob
Module ZODB.blob, line 717, in _blob_storeblob
Module ZODB.blob, line 435, in getPathForOID

AssertionError

Afficher les traces des erreurs sous forme de texte
REQUETE (QUERY)
form
form.widgets.IOwnership.creators u'admin'
form.widgets.IPublication.expires u''
form.widgets.ICategorization.language u'fr'
form.widgets.IAllowDiscussion.allow_discussion [u'--NOVALUE--']
form.widgets.IOwnership.rights u''
form.widgets.IShortName.id u''
form.widgets.ICategorization.subjects u''
form.widgets.IPublication.effective u''
form.widgets.IOwnership.contributors u''
form.widgets.IAllowDiscussion.allow_discussion-empty-marker u'1'
form.widgets.title u''
form.widgets.description u''
form.widgets.image <ZPublisher.HTTPRequest.FileUpload instance at 0x7fd3c5fb2680>
form.widgets.IExcludeFromNavigation.exclude_from_nav-empty-marker u'1'
form.buttons.save u'Enregistrer'
_submit [u'', u'', u'', u'']
disable_border True
_authenticator u'59bd5521c2476ac768b3374dd6159d4754bed805'
form.widgets.IRelatedItems.relatedItems u''

***/
Has someone met a similar problem? If so, any help or advice would be very much appreciated.

the ZODB code is not difficult to understand:

        if create and not os.path.exists(path):
            try:
                os.makedirs(path)
            except OSError:
                # We might have lost a race.  If so, the directory
                # must exist now
                assert os.path.exists(path)

zodb tries to create a directory and gets an error, if after the errors the directory exists it's assumed that another Zope proces tried to create the directory at the same time. If that's not the case the error can't be recovered.
So take a look at your vm with a tool like df (df and df --i to check inodes). If nothing looks like an exhausted resource try to create a few directories by hand in the volume containing your zodb blob data (if your machine is on a VP the problem could come from a configuration by your provider).

Thank you very much for your prompt reply, gp54321. I did not forget the patience you had helping me on my problem with the Nginx server last year.

After a first check with 'df -i', unless I missed it, I didn't find anything looking like an exhausted resource on my VPS configuration. However, the 'var/blobstorage' directory in zeocluster is empty. I assume this is where my zodb blob data is stored. Am I correct?

Usually it's named blobstorage, yes. It's surprising that in a running installation it could be empty, so unless you know it's a new setup you can check the place where it's supposed to be in the configuration file(s); usually it's referenced as blob-dir in the zope.conf (also zeo.conf if it's a zeo configuration).

Yes, it is a new setup, with a zeocluster configuration. Both the zeo.conf file (in '/zeocluster/parts/zeoserver/etc/zeo.conf') and the zope.conf file (in '/parts/client1/etc/zope.conf') indeed show the blob-dir path, but the 'blobstorage/tmp' directory is still empty.

in this case, you should try to create a subdirectory in the blobstorage directory. If there is a specific user for running Plone (plone_daemon ?) you should first use something like sudo su plone_daemon. If there is a logic in this madness, it should fail and you should get an enlightening error message - maybe no permission or something else.
I have never taken the time to lookup the use for the tmp subdirectory but that's not the place where the blobs are stored, new subdirectories are created when blobs are created.

Hello gp54321,

At last, the problem is solved. The cause was an iptables issue in the configuration of my site's firewall that I had missed. It did take me a while to find out about it, though. But now things have gone back to normal.

Thank you so much again for your help.

 Best

well, thanks for closing the issue; yet I am a bit disappointed in not understanding at all how a firewall issue could trigger this backtrace :frowning:

Hi!

I did installed a zeo but I decided it wasn't needed so after thar I installed Standalone on the same machine, and now I'm getting the same error as the described, "Assertion error", when I try to add an image to any content type:

ERROR Zope.SiteErrorLog 1543491800.340.438766733372 http://10.120.0.172:8080/icas/espacios/casino/entradas/@@edit Traceback (innermost last): Module ZPublisher.Publish, line 146, in publish Module Zope2.App.startup, line 303, in commit Module transaction._manager, line 131, in commit Module transaction._transaction, line 310, in commit Module transaction._transaction, line 301, in commit Module transaction._transaction, line 446, in _commitResources Module transaction._transaction, line 420, in _commitResources Module ZODB.Connection, line 493, in commit Module ZODB.Connection, line 1054, in _commit_savepoint Module ZODB.mvccadapter, line 170, in storeBlob Module ZODB.blob, line 730, in storeBlob Module ZODB.blob, line 717, in _blob_storeblob Module ZODB.blob, line 435, in getPathForOID AssertionError

Do you know why is this happening? Do I have to remove the zeo installation folder or there is an specific way to edit/remove the zeo config?

Thank youu!

I just had the same error because of rights (permissions on the blob folder) . Just changing owner does the trick.