Hello,
First, thank you for the deploy ecosystem for D8.
I am currently testing the deploy ecosystem and I found the video about the content hub (https://www.youtube.com/watch?v=CTqAyYcLZB0) and couchDB and I wanted to test it.
I am on Drupal 8.1.10 and the dev version for each deploy ecosystem modules.
I installed a couchDB 2.0.0 and when I try to push to it I got the following errors
Symfony\Component\HttpKernel\Exception\BadRequestHttpException: history.0.recorded_seq: This value should be of the correct primitive type.. history.0.start_last_seq: This value should be of the correct primitive type. in Drupal\relaxed\Plugin\rest\resource\ResourceBase->validate() (line 115 of /modules/contrib/relaxed/src/Plugin/rest/resource/ResourceBase.php).
Doctrine\CouchDB\HTTP\HTTPException: HTTP Error with status 400 occurred while requesting /couchdb/_local/2b45f3c66e06e911e87f6e6db49c11bb. Error: bad_request history.0.recorded_seq: This value should be of the correct primitive type.. history.0.start_last_seq: This value should be of the correct primitive type. in Doctrine\CouchDB\HTTP\HTTPException::fromResponse() (line 68 of /vendor/doctrine/couchdb/lib/Doctrine/CouchDB/HTTP/HTTPException.php).
And I tested with a couchDB in a Docker container and it worked. https://hub.docker.com/_/couchdb/. 1.6.1
I don't know if it is a known bug. Currently I don't have any couchDB version imposed and that does not block my tests.
Comments
Comment #2
grimreaperHello,
I saw that couchdb 2.0.0 responded with strings for the sequence so I changed the DataDefinition for the ReplicationHistoryItem.
Here is a quick fix I don't know the implication of this change.
By the way, I am on Drupal 8.2.*
Thanks for the review.
Comment #4
dixon_Awesome, very simple patch. However, we will need a
hook_update_N()to handle the upgrade for existing sites and fix the tests for this.Comment #5
grimreaperThanks for the reply.
I will see next week if I can provide the hook_update_n.
About the tests, I don't exactly see the link between the errors and the patch.
Comment #6
jeqq commented@Grimreaper These errors are not related to your patch. We test CouchDB integration with Travis CI (see tests classes in tests/src/Integration/ folder, we run them in tests/bin/replication.sh): https://travis-ci.org/relaxedws/drupal-relaxed.
Comment #7
grimreaper@jeqq: ok thanks for the answer.
I will not have time for a patch this week sorry.
I will try when I will get time.
Comment #8
grimreaperHello,
Here is a new patch with an attempt of hook_update_n.
It is inspired of system_update_8007(), unfortunately it does not work, I have the following error:
I found examples in core or in the paragraph module how to update base field definitions on content entities but not how to update property definitions on field types.
I also found that I forgot to change the schema for the properties.
Thanks for the review or any help.
Comment #9
jeqq commentedHere is a patch based on #8, it fixes the problem with the existing data error (it migrates data to the modified tables). Other fixes. After applying the update I was able to replicate data between Drupal and CouchDB 2.
Comment #10
jeqq commentedRefactored the update function.
Comment #12
jeqq commentedComment #13
grimreaperThanks @jeqq for the commit. Sorry for not answering before.
Comment #14
damiankloip commentedI second that - thanks @jeqq!!