400 invalid database name "favicon.ico"


#1

Hi ,
I have installed Couchbase server 3 node cluster and sync gateway(on dedicated linux ec2 ).
my application is able to establish the connection with sync-gateway and fetch all documents.
but when trying to fetch a particular doc unable to process my request.

then happen to see some error in the syn-gateway/logs/errorlogs
g 15 22:44:02 ip-172-31-8-148.us-east-2.compute.internal systemd[1]: Starting Couchbase Sync Gateway server…

Aug 15 22:44:02 ip-172-31-8-148.us-east-2.compute.internal systemd[1]: Started Couchbase Sync Gateway server.

[root@ip-172-31-8-148 ec2-user]# cat /home/sync_gateway/logs/sync_gateway_error.log

2018-08-14T21:56:03.713Z Enabling logging: [HTTP+]

2018-08-14T21:56:03.713Z ==== Couchbase Sync Gateway/2.0.0(832;2d8a6c0) ====

2018-08-14T21:56:03.713Z requestedSoftFDLimit < currentSoftFdLimit (5000 < 65535) no action needed

2018-08-14T21:56:03.713Z Opening db /db as bucket “db”, pool “default”, server <walrus:data>

2018-08-14T21:56:03.713Z Opening Walrus database db on <walrus:data>

2018-08-14T21:56:03.713Z Design docs for current view version (2.0) do not exist - creating…

2018-08-14T21:56:03.713Z Design docs successfully created for view version 2.0.

2018-08-14T21:56:03.713Z Verifying view availability for bucket db…

2018-08-14T21:56:03.714Z Views ready for bucket db.

2018-08-14T21:56:03.714Z Initializing changes cache for database db with sequence: 0

2018-08-14T21:56:03.714Z Using default sync function ‘channel(doc.channels)’ for database “db”

2018-08-14T21:56:03.714Z Reset guest user to config

2018-08-14T21:56:03.714Z Starting admin server on 127.0.0.1:4985

2018-08-14T21:56:03.717Z Starting server on 0.0.0.0:4984 …

2018-08-14T22:13:34.213Z HTTP: #001: GET / (as )

2018-08-14T22:13:34.213Z HTTP+: #001: --> 200 (0.2 ms)

2018-08-14T22:13:59.252Z HTTP: #002: GET / (as )

2018-08-14T22:13:59.253Z HTTP+: #002: --> 200 (0.1 ms)

2018-08-14T22:14:00.706Z HTTP: #003: GET /favicon.ico/ (as )

2018-08-14T22:14:00.706Z HTTP: #003: --> 400 invalid database name “favicon.ico” (0.1 ms)

2018-08-14T22:57:12.603Z Enabling logging: [HTTP+]

2018-08-14T22:57:12.603Z ==== Couchbase Sync Gateway/2.0.0(832;2d8a6c0) ====

2018-08-14T22:57:12.603Z requestedSoftFDLimit < currentSoftFdLimit (5000 < 65535) no action needed

2018-08-14T22:57:12.603Z Opening db /db as bucket “db”, pool “default”, server <walrus:data>

2018-08-14T22:57:12.605Z Opening Walrus database db on <walrus:data>

2018-08-14T22:57:12.606Z Design docs for current SG view version (2.0) found.

2018-08-14T22:57:12.606Z Verifying view availability for bucket db…

2018-08-14T22:57:12.743Z Views ready for bucket db.

2018-08-14T22:57:12.743Z Initializing changes cache for database db with sequence: 1

2018-08-14T22:57:12.743Z Using default sync function ‘channel(doc.channels)’ for database “db”

2018-08-14T22:57:12.744Z Reset guest user to config

2018-08-14T22:57:12.744Z Starting admin server on 127.0.0.1:4985

2018-08-14T22:57:12.749Z Starting server on 0.0.0.0:4984 …

2018-08-14T23:02:35.924Z HTTP: #001: GET / (as )

2018-08-14T23:02:35.925Z HTTP+: #001: --> 200 (0.9 ms)

2018-08-14T23:02:37.709Z HTTP: #002: GET /favicon.ico/ (as )

2018-08-14T23:02:37.709Z HTTP: #002: --> 400 invalid database name “favicon.ico” (0.1 ms)

2018-08-15T06:34:35.634Z HTTP: #003: GET / (as ADMIN)

2018-08-15T06:34:35.634Z HTTP+: #003: --> 200 (0.1 ms)

2018-08-15T06:34:52.929Z HTTP: #004: GET / (as )

2018-08-15T06:34:52.929Z HTTP+: #004: --> 200 (0.1 ms)

2018-08-15T06:36:03.522Z HTTP: #005: GET / (as )

2018-08-15T06:36:03.522Z HTTP+: #005: --> 200 (0.1 ms)

2018-08-15T06:36:04.997Z HTTP: #006: GET /favicon.ico/ (as )

2018-08-15T06:36:04.997Z HTTP: #006: --> 400 invalid database name “favicon.ico” (0.1 ms)

2018-08-15T06:39:25.264Z Enabling logging: [HTTP+]

2018-08-15T06:39:25.264Z ==== Couchbase Sync Gateway/2.0.0(832;2d8a6c0) ====

2018-08-15T06:39:25.264Z requestedSoftFDLimit < currentSoftFdLimit (5000 < 65535) no action needed

2018-08-15T06:39:25.264Z Opening db /db as bucket “db”, pool “default”, server <walrus:data>

2018-08-15T06:39:25.265Z Opening Walrus database db on <walrus:data>

2018-08-15T06:39:25.265Z Design docs for current SG view version (2.0) found.

2018-08-15T06:39:25.265Z Verifying view availability for bucket db…

2018-08-15T06:39:25.317Z Views ready for bucket db.

2018-08-15T06:39:25.317Z Initializing changes cache for database db with sequence: 1

2018-08-15T06:39:25.317Z Using default sync function ‘channel(doc.channels)’ for database “db”

2018-08-15T06:39:25.317Z Reset guest user to config

2018-08-15T06:39:25.317Z Starting admin server on 127.0.0.1:4985

2018-08-15T06:39:25.320Z Starting server on 0.0.0.0:4984 …

2018-08-15T07:02:40.299Z Enabling logging: [*]

what could be issue ?

one more thing is am unable to access sync-gateway admin console on port http://publicIp:4985/_admin
respons on page : refused to connect . ( i have set same rules for 4984-4985)
But i m able to access sync-gateway connection validation on http://publicIP:4984.
response : {“couchdb”:“Welcome”,“vendor”:{“name”:“Couchbase Sync Gateway”,“version”:“2.0”},“version”:“Couchbase Sync Gateway/2.0.0(832;2d8a6c0)”}


#2

There is no real error here, just your browser making additional requests behind the scenes. Pretty much all web browsers automatically make a HTTP GET request to “/favicon.ico” of any site as a means of getting an icon for the website.

Also the admin port is not meant to be publicly accessible, as there is no authentication on that port. It can still be accessed over localhost. If you wanted to, you can open it up using the ‘adminInterface’ configuration option, but this is extremely dangerous to do.


#3

Thanks for your reply .
here when trying to fetch a particular doc unable to process my request , but for all docs it throws the result.

How to get into into Admin Interface ? (is there any UI or else on command line ?)

unable to figure out how to enable authentication mechanisam for Sync-gateway (like how to create a user and all )


#4

I can’t see any indication in the logs you provided that you’re attempting to get a document.

How are you trying to retrieve it? GET http://hostname:4984/db/doc1 ?

I would advise reading this Authorizing Users guide from the documentation:
https://developer.couchbase.com/documentation/mobile/2.0/guides/sync-gateway/authorizing-users/index.html


#5

There’s something strange in your logs. It shows SG using the walrus database, which means it’s not connecting to Couchbase Server. Can you post your SG config file?

For authentication, you can provide a user in the the users section. There are several example config files in the Sync Gateway distribution. You might want to look at those some. You can also check out our blogs. This one might help: https://blog.couchbase.com/getting-comfortable-with-couchbase-mobile-sync-gateway-via-the-command-line/


#6

sure Greeley,
here is my syncgateway json file

/home/sync_gateway/sync_gateway.json
{
“log”: [""],
“databases”: {
“active”: {
“server”: “publicIp:8091”,
“bucket”: “active”,
“username”: “sync-user”,
“password”: "
*******",
“enable_shared_bucket_access”: true,
“import_docs”: “continuous”,
“users”: { “GUEST”: { “disabled”: false, “admin_channels”: ["
"] } }
}
}
}


#7

Greeley,
did you get a chance to look at my config file ?
waiting for your response.


#8

I’m a bit confused. The logs you posted can’t have come from using this config file. For example, the log line 2018-08-14T21:56:03.713Z Opening db /db as bucket “db”, pool “default”, server <walrus:data> would only come from having a entry db entry under databases. That line also indicates you’re not connecting to a Couchbase server cluster.

Also, how are you trying to retrieve single documents?

You can create users in the Sync Gateway config, or dynamically. To see how it’s done in the config file, you can read the docs or look at the examples distributed with Sync Gateway.


#9

Actually using this Config file my application was able to send documents to couchbase cluster .

Thanks

Rohith vuppala

203-900-7999


#10

So is there still a problem you’re having?


#11

Yeah, application is unable to read the data from this sync channel .

Can you help me out and guide me way to fix this.

I know something is wrong , I m new to this sync gateway.

Thanks

Rohith vuppala

203-900-7999


#12

I’m not sure if the config you’re showing copied over correctly.

If you have "users": { "GUEST": { "disabled": false, "admin_channels": ["*"] } }, then you don’t need to do any authentication to Sync Gateway, and all channels are accessible. This is the easiest way to try out syncing.


#13

this is the location of my config file /home/sync_gateway/sync_gateway.json
{
“log”: [""],
“databases”: {
“active”: {
“server”: “http://ec2-*****-36.us-east-2.compute.amazonaws.com:8091”,
“bucket”: “active”,
“username”: “sync-user”,
“password”: “gateway”,
“enable_shared_bucket_access”: true,
“import_docs”: “continuous”,
“users”: { “GUEST”: { “disabled”: false, “admin_channels”: ["
"] } }
}
}
}

this is my config file stored in the above mentioned location.
i have one more question in above config file ,there is field databases and again bucket field .why there is term called database being used in couchbase ?

please shed me some light here and help me to fix this issue.
thanks


#14

I’m not sure I’m understanding your question. Couchbase Server and Couchbase Lite are both NoSQL document oriented databases. Buckets are a high level organizational structure within Couchbase Server. So the Sync Gateway databases config section is used to specify all the parameters you need to access a bucket in the database.

Your config file does not give the GUEST user access to any channels. This means GUEST access can only get documents assigned to the public channel. So if you’re documents are assigned to any other channel (which can happen with the default sync function), your application won’t have access. You need the line fixed the way I showed earlier. This can be confusing, because you can write to the database without access to any channels. In fact, it’s easy to set it up so a user can write a document, but not have permissions to read it back.