Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows line breaks in sync function cause SG to fail #783

Closed
adamcfraser opened this issue Apr 17, 2015 · 9 comments
Closed

Windows line breaks in sync function cause SG to fail #783

adamcfraser opened this issue Apr 17, 2015 · 9 comments
Assignees
Milestone

Comments

@adamcfraser
Copy link
Collaborator

Multi-line sync functions in config files that are stored with Windows line breaks aren't parsed properly by Sync Gateway.

More details here:
https://issues.couchbase.com/browse/CBSE-1778

@zgramana zgramana added ready and removed backlog labels May 8, 2015
@ajres ajres added in progress and removed ready labels May 12, 2015
ajres pushed a commit that referenced this issue May 15, 2015
…this is an issue for users writing SG config files on MS Windows, see #783 for an example
@ajres ajres added review and removed in progress labels May 15, 2015
@ajres ajres assigned adamcfraser and ajres and unassigned ajres and adamcfraser May 15, 2015
@ajres ajres added in progress and removed review labels May 15, 2015
@zgramana zgramana modified the milestone: 1.1.0 Jun 11, 2015
@alex7egli
Copy link

Tested this on Azure Ubuntu 12.04.5 box and Couchbase Sync Gateway/1.1.0(28;86f028c) still fails to start with windows line breaks. Have to run through cygwin dos2unix command to get sync gateway to start after editing the config file on windows. Error:
2015-07-13T13:51:29.536Z FATAL: Error reading config file sync-gateway-config.json: invalid character '\r' in string literal -- rest.ParseCommandLine() at config.go:336

@ajres
Copy link

ajres commented Jul 13, 2015

@alex7egli

Can you upload your breaking config to a gist and post a link to this ticket.

Andy

@alex7egli
Copy link

It's for our company's database, so for security reasons I would prefer not to upload the file. Would a snippet be sufficient?

@ajres
Copy link

ajres commented Jul 13, 2015

@alex7egli

Any valid self contained config.json that exhibits the issue would be fine.

Andy

@alex7egli
Copy link

Just tested with this config and same issue with same error:
https://gist.github.com/alex7egli/f136b8a9e8ed99de7d06

I upgraded from SG Community 1.0.2 to SG Enterprise 1.1.0 by doing dpkg -r on the old sync gateway package, and then dpkg -i on the new package.

@ajres ajres reopened this Jul 13, 2015
@ajres
Copy link

ajres commented Jul 14, 2015

That config worked on MAC OS X, but I didn't see any \r chars, it possible they got stripped when unpacking the archive. I'm going to run the same config with SG on Ubuntu 12.

@alex7egli
Copy link

The steps I use to update our config are:

  1. Modify the file on my windows machine in a text editor.
  2. Copy them to our server using WinSCP
  3. Restart sync gateway

I have to run dos2unix to on the config file before copying it to the server though to fix the endline chars for unix.

@ajres
Copy link

ajres commented Jul 15, 2015

I have reproduce this issue on 1.1.0 enterprise binary release.

Release note says that "#783 Windows line breaks in sync function cause SG to fail" is included, but it is not.

Testing against latest master, Sync Gateway starts without error.

@ajres
Copy link

ajres commented Jul 15, 2015

Reclosing this ticket, issue with release build is tracked in new issue #987

@ajres ajres closed this as completed Jul 15, 2015
@ajres ajres removed the in progress label Jul 15, 2015
ajres pushed a commit that referenced this issue Aug 3, 2015
…this is an issue for users writing SG config files on MS Windows, see #783 for an example
@zgramana zgramana modified the milestones: 1.1.1, 1.1.0 Aug 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants