Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Step to replicate the problem.
D7.10
views 3.0
ctools 1.0-rc1
search_api 1.0
search_api_solr 1.0-rc1
after i create a solr views (only with typology views) and when i add display
Notice: unserialize(): Error at offset 11253 of 11256 bytes in ctools_object_cache_get() (linea 41 di /home/dev/workspace/mysite/sites/all/modules/contrib/ctools/includes/object-cache.inc).
and then "access denied"
this issiue is also here http://drupal.org/node/1370724
The problem is only with postgres db, with mysql is working normally
Comment | File | Size | Author |
---|---|---|---|
#9 | ctools-fix-postgresql-cache-error-with-data-column-typecast-1377634-09.patch | 1.69 KB | thekevinday |
#8 | ctools-fix-postgresql-cache-error-with-data-column-typecast-1377634-08.patch | 1.54 KB | bendiy |
#1 | solr1.png | 103.41 KB | ulyx451 |
#1 | solr2.png | 85.63 KB | ulyx451 |
Comments
Comment #1
ulyx451 CreditAttribution: ulyx451 commentedSome screenshot
Comment #2
arrubiu CreditAttribution: arrubiu commentedI've tryed and I notice that when ctools add to database the cache, it serializes the $cache.
Serializing the $cache variable I notice that the string as many "\", backslashes that broke the query insert, so in the db, when the function ctools_object_cache_get, the serialize of the result of the query fails and I obtain the error in the screenshot.
The abstraction layer for postgres does not add any "escaping" function to the query..
I've tryed to base64_encode the data before the insert query, and obviously base64_decode after the ctools_object_cache_get function, and everything seems ok, but I think it isn't the right way.
So now I've, in my object-cache.inc:
Line 40-42:
And line 67-75:
Any other solution?
Sergio
Comment #3
dema502 CreditAttribution: dema502 commentedI've catched same error in my PostgreSQL
I change Db schema for fix
before:
after:
patch
Comment #4
arrubiu CreditAttribution: arrubiu commentedOk thanks a lot.
Sorry, but I'm not an expert of drupal.org and patches ;)
I've to submit this patch in the -dev release?
Thanks,
Sergej
Comment #5
Peter Bex CreditAttribution: Peter Bex commentedThis is the same problem as #865142: Make ctools_object_cache.data DB column blob for storing arbitrary bytes. and #690746: Text column type doesn't reliably hold serialized variables, the latter of which was opened a year ago (and hasn't been fixed, just marked duplicate of the former). I really wish this was fixed properly because without a proper fix, using Drupal under Postgres (and possibly other DBMSes) is not feasible. :(
Comment #6
bendiy CreditAttribution: bendiy commented#3 fixed this for me on PostgreSQL 9.1.
I got a similar error when trying to add content to a Pane in Panels. I added a ECK entity in the Panel "Contexts". When I go to "Content" and add a field from that ECK entity to a pane, I get the error when I click "Update" or "Update and Save".
It's working now after #3. Thanks!
Comment #7
merlinofchaos CreditAttribution: merlinofchaos commentedCan't be RTBC, there's no patch.
Comment #8
bendiy CreditAttribution: bendiy commentedPatch attached.
I put the change in ctools_schema_2() and ctools_update_6008(). Not sure if one is better than the other.
Comment #9
thekevinday CreditAttribution: thekevinday commentedDoes not work:
It turns out if certain text information is inside of data, then the alter will not work.
The solution is to clear the tools object cache immediately before doing the alter.
After making this change I managed to apply the update and confirm that the changes work.
Also, I added a description to the update.
Comment #10
merlinofchaos CreditAttribution: merlinofchaos commentedCommitted and pushed, but I had to adjust it to a 'big' blog, so that it's a longblob in mysql. Otherwise the data size is way too small for anything.