mozilla-services / syncserver

Run-Your-Own Firefox Sync Server
Mozilla Public License 2.0
1.87k stars 145 forks source link

Error creating table when using mysql backend #75

Closed godfuture closed 8 years ago

godfuture commented 8 years ago

An mysql error is thown when trying to sync. BLOB, TEXT, GEOMETRY or JSON column 'payload' can't have a default value

Faulty statement: CREATE TABLE bso (userid INTEGER NOT NULL, collection INTEGER NOT NULL, id VARCHAR(64) NOT NULL, sortindex INTEGER, modified BIGINT NOT NULL, payload TEXT(262144) DEFAULT '' NOT NULL, payload_size INTEGER DEFAULT 0 NOT NULL, ttl INTEGER DEFAULT 2100000000, PRIMARY KEY (userid, collection, id)) ENGINE=InnoDB CHARSET=latin1

Workaround After I have created the table my own without TEXT Default on payload column, it worked.

Ubuntu 16.04 Mysql 5.7.12 Syncserver checked out today

rfk commented 8 years ago

Thanks @godfuture, looks like we need to handle defaults for that column in the code. I've got a change to hopefully fix this at:

https://github.com/mozilla-services/server-syncstorage/pull/34

Would you be comfortable trying to install this from github and test whether it fixes the problem for you? I can provide instructions if necessary.

godfuture commented 8 years ago

I guess I would have to DROP the table? Maybe all? How to reset my sync database the best?

Instructions please! ;-)

rfk commented 8 years ago

The PR has been merged, so if you git pull to updated to the latest version of the syncserver repo you should get the fix.

If I understand correctly, the creation of the table failed, so you shouldn't need to drop it. You may find that it all just starts working when you update to the latest code. If not, then yes, I suggest dropping any tables that the old version of the code may have created.

godfuture commented 8 years ago

It seems the sync works now, but unfortunately not all bookmarks are getting synced. Only certain desktop folders appear in the Android navigation, meaning the structure is not complete. Bookmarks in folders are missing.

Besides that I noticed some other bigger and smaller issues...my beloved desktop passwords are not synced to my mobile device. I researched it in the web and found out that master password would break the sync. I really do not get it, I mean, I would have expected the opposite as master passwords protect the data by encrypting it. But password sync getting stopped by using master password? Strange...I guess the sync backend is not ready for daily use.

Well, this ticket is solved. Thanks for that, but I guess I will stop with sync 1.5 for now.

rfk commented 8 years ago

I researched it in the web and found out that master password would break the sync

If I understand correctly, this was the case for a few releases but should be fixed in recent firefox versions. I'm not aware of any issues with master password preventing passwords from being synced.

godfuture commented 8 years ago

Just to let you know and wipe the negative comment of mine...Not giving up I deleted my fxa account and recreated it. I also cleared database. Then reconnected all devices. Now, the first time Android syncs my passwords and all bookmarks. I tested also the follow up sync.