Closed greezlyk closed 8 years ago
Hi @greezlyk
can you please paste the logs of RESTHeart?
also make sure you are using the configuration files restheart.yml
and security.yml
shipped with this repo and not the default one that comes with the docker image
for this you can use the data volume feature of docker https://docs.docker.com/engine/userguide/containers/dockervolumes/
copy the two files in etc dir
$ docker run -d -p 80:8080 -v etc:/opt/restheart/etc --name restheart --link mongodb:mongodb softinstigate/restheart
I have mounted both restheart.yml security.yml root@09e12507d2a1:/opt/restheart/etc# ls restheart.yml restheartd.conf security.yml
Here the log file from Restheart docker image:
20:28:15.001 [main] INFO org.restheart.Bootstrapper - Starting RESTHeart 20:28:15.004 [main] INFO org.restheart.Bootstrapper - version 1.1.3 20:28:15.006 [main] INFO org.restheart.Bootstrapper - Logging to console with level INFO 20:28:15.167 [main] INFO org.restheart.Bootstrapper - MongoDB connection pool initialized 20:28:15.167 [main] INFO org.restheart.Bootstrapper - MongoDB version 3.0.8 20:28:15.279 [main] INFO org.restheart.Bootstrapper - Token based authentication enabled with token TTL 15 minutes 20:28:15.425 [main] INFO org.restheart.Bootstrapper - HTTPS listener bound at 0.0.0.0:4443 20:28:15.425 [main] INFO org.restheart.Bootstrapper - HTTP listener bound at 0.0.0.0:8080 20:28:15.426 [main] INFO org.restheart.Bootstrapper - Local cache for db and collection properties enabled 20:28:15.449 [main] INFO org.restheart.Bootstrapper - URL / bound to MongoDB resource * 20:28:15.509 [main] INFO org.restheart.Bootstrapper - Embedded static resources browser extracted in /tmp/restheart-7401721267377391771 20:28:15.514 [main] INFO org.restheart.Bootstrapper - URL /browser bound to static resources browser. access manager: false 20:28:15.515 [main] INFO org.restheart.Bootstrapper - URL /_logic/ping bound to application logic handler org.restheart.handlers.applicationlogic.PingHandler. access manager: false 20:28:15.516 [main] INFO org.restheart.Bootstrapper - URL /_logic/roles bound to application logic handler org.restheart.handlers.applicationlogic.GetRoleHandler. access manager: false 20:28:15.636 [main] INFO org.restheart.Bootstrapper - Pid file /var/run/restheart--1441246088.pid 20:28:15.636 [main] INFO org.restheart.Bootstrapper - RESTHeart started
log with ALL mode:
21:44:08.514 [main] INFO org.restheart.Bootstrapper - Starting RESTHeart 21:44:08.516 [main] INFO org.restheart.Bootstrapper - version 1.1.3 21:44:08.519 [main] WARN org.restheart.Bootstrapper - Found pid file! If this instance is already running, startup will fail with a BindException 21:44:08.519 [main] INFO org.restheart.Bootstrapper - Logging to console with level ALL 21:44:08.523 [main] DEBUG org.restheart.Bootstrapper - Initializing MongoDB connection pool to [mongodb] with options MongoClientOptions{description='null', readPreference=primary, writeConcern=WriteConcern{w=null, wTimeout=null ms, fsync=null, journal=null, readConcern=com.mongodb.ReadConcern@0, codecRegistry=org.bson.codecs.configuration.ProvidersCodecRegistry@455c1c1d, commandListeners=[], minConnectionsPerHost=0, maxConnectionsPerHost=100, threadsAllowedToBlockForConnectionMultiplier=5, serverSelectionTimeout=30000, maxWaitTime=120000, maxConnectionIdleTime=0, maxConnectionLifeTime=0, connectTimeout=10000, socketTimeout=0, socketKeepAlive=false, sslEnabled=false, sslInvalidHostNamesAllowed=false, alwaysUseMBeans=false, heartbeatFrequency=10000, minHeartbeatFrequency=500, heartbeatConnectTimeout=20000, heartbeatSocketTimeout=20000, localThreshold=15, requiredReplicaSetName='null', dbDecoderFactory=com.mongodb.DefaultDBDecoder$1@73d4cc9e, dbEncoderFactory=com.mongodb.DefaultDBEncoder$1@80169cf, socketFactory=javax.net.DefaultSocketFactory@5427c60c, cursorFinalizerEnabled=true, connectionPoolSettings=ConnectionPoolSettings{maxSize=100, minSize=0, maxWaitQueueSize=500, maxWaitTimeMS=120000, maxConnectionLifeTimeMS=0, maxConnectionIdleTimeMS=0, maintenanceInitialDelayMS=0, maintenanceFrequencyMS=60000}, socketSettings=SocketSettings{connectTimeoutMS=10000, readTimeoutMS=0, keepAlive=false, receiveBufferSize=0, sendBufferSize=0}, serverSettings=ServerSettings{heartbeatFrequencyMS=10000, minHeartbeatFrequencyMS=500}, heartbeatSocketSettings=SocketSettings{connectTimeoutMS=20000, readTimeoutMS=20000, keepAlive=false, receiveBufferSize=0, sendBufferSize=0}} 21:44:08.697 [main] INFO org.restheart.Bootstrapper - MongoDB connection pool initialized 21:44:08.697 [main] INFO org.restheart.Bootstrapper - MongoDB version 3.0.8 21:44:08.811 [main] INFO org.restheart.Bootstrapper - Token based authentication enabled with token TTL 15 minutes 21:44:08.962 [main] INFO org.restheart.Bootstrapper - HTTPS listener bound at 0.0.0.0:4443 21:44:08.963 [main] INFO org.restheart.Bootstrapper - HTTP listener bound at 0.0.0.0:8080 21:44:08.964 [main] INFO org.restheart.Bootstrapper - Local cache for db and collection properties enabled 21:44:08.972 [main] DEBUG o.r.handlers.RequestDispacherHandler - Initialize default HTTP handlers: 21:44:08.975 [main] DEBUG o.r.handlers.RequestDispacherHandler - putPipedHttpHandler( ROOT, GET, org.restheart.handlers.root.GetRootHandler ) 21:44:08.976 [main] DEBUG o.r.handlers.RequestDispacherHandler - putPipedHttpHandler( DB, GET, org.restheart.handlers.database.GetDBHandler ) 21:44:08.977 [main] DEBUG o.r.handlers.RequestDispacherHandler - putPipedHttpHandler( DB, PUT, org.restheart.handlers.database.PutDBHandler ) 21:44:08.977 [main] DEBUG o.r.handlers.RequestDispacherHandler - putPipedHttpHandler( DB, DELETE, org.restheart.handlers.database.DeleteDBHandler ) 21:44:08.977 [main] DEBUG o.r.handlers.RequestDispacherHandler - putPipedHttpHandler( DB, PATCH, org.restheart.handlers.database.PatchDBHandler ) 21:44:08.977 [main] DEBUG o.r.handlers.RequestDispacherHandler - putPipedHttpHandler( COLLECTION, GET, org.restheart.handlers.collection.GetCollectionHandler ) 21:44:08.980 [main] DEBUG o.r.handlers.RequestDispacherHandler - putPipedHttpHandler( COLLECTION, POST, org.restheart.handlers.collection.PostCollectionHandler ) 21:44:08.980 [main] DEBUG o.r.handlers.RequestDispacherHandler - putPipedHttpHandler( COLLECTION, PUT, org.restheart.handlers.collection.PutCollectionHandler ) 21:44:08.980 [main] DEBUG o.r.handlers.RequestDispacherHandler - putPipedHttpHandler( COLLECTION, DELETE, org.restheart.handlers.collection.DeleteCollectionHandler ) 21:44:08.980 [main] DEBUG o.r.handlers.RequestDispacherHandler - putPipedHttpHandler( COLLECTION, PATCH, org.restheart.handlers.collection.PatchCollectionHandler ) 21:44:08.980 [main] DEBUG o.r.handlers.RequestDispacherHandler - putPipedHttpHandler( DOCUMENT, GET, org.restheart.handlers.document.GetDocumentHandler ) 21:44:08.981 [main] DEBUG o.r.handlers.RequestDispacherHandler - putPipedHttpHandler( DOCUMENT, PUT, org.restheart.handlers.document.PutDocumentHandler ) 21:44:08.981 [main] DEBUG o.r.handlers.RequestDispacherHandler - putPipedHttpHandler( DOCUMENT, DELETE, org.restheart.handlers.document.DeleteDocumentHandler ) 21:44:08.981 [main] DEBUG o.r.handlers.RequestDispacherHandler - putPipedHttpHandler( DOCUMENT, PATCH, org.restheart.handlers.document.PatchDocumentHandler ) 21:44:08.981 [main] DEBUG o.r.handlers.RequestDispacherHandler - putPipedHttpHandler( COLLECTION_INDEXES, GET, org.restheart.handlers.indexes.GetIndexesHandler ) 21:44:08.981 [main] DEBUG o.r.handlers.RequestDispacherHandler - putPipedHttpHandler( INDEX, PUT, org.restheart.handlers.indexes.PutIndexHandler ) 21:44:08.981 [main] DEBUG o.r.handlers.RequestDispacherHandler - putPipedHttpHandler( INDEX, DELETE, org.restheart.handlers.indexes.DeleteIndexHandler ) 21:44:08.981 [main] DEBUG o.r.handlers.RequestDispacherHandler - putPipedHttpHandler( FILES_BUCKET, GET, org.restheart.handlers.collection.GetCollectionHandler ) 21:44:08.982 [main] DEBUG o.r.handlers.RequestDispacherHandler - putPipedHttpHandler( FILES_BUCKET, POST, org.restheart.handlers.files.PostBucketHandler ) 21:44:08.982 [main] DEBUG o.r.handlers.RequestDispacherHandler - putPipedHttpHandler( FILES_BUCKET, PUT, org.restheart.handlers.files.PutBucketHandler ) 21:44:08.984 [main] DEBUG o.r.handlers.RequestDispacherHandler - putPipedHttpHandler( FILES_BUCKET, DELETE, org.restheart.handlers.files.DeleteBucketHandler ) 21:44:08.984 [main] DEBUG o.r.handlers.RequestDispacherHandler - putPipedHttpHandler( FILE, GET, org.restheart.handlers.files.GetFileHandler ) 21:44:08.984 [main] DEBUG o.r.handlers.RequestDispacherHandler - putPipedHttpHandler( FILE_BINARY, GET, org.restheart.handlers.files.GetFileBinaryHandler ) 21:44:08.985 [main] DEBUG o.r.handlers.RequestDispacherHandler - putPipedHttpHandler( FILE, PUT, org.restheart.handlers.files.PutFileHandler ) 21:44:08.985 [main] DEBUG o.r.handlers.RequestDispacherHandler - putPipedHttpHandler( FILE, DELETE, org.restheart.handlers.files.DeleteFileHandler ) 21:44:08.986 [main] DEBUG o.r.handlers.RequestDispacherHandler - putPipedHttpHandler( AGGREGATION, GET, org.restheart.handlers.aggregation.GetAggregationHandler ) 21:44:08.999 [main] INFO org.restheart.Bootstrapper - URL / bound to MongoDB resource * 21:44:09.087 [main] INFO org.restheart.Bootstrapper - Embedded static resources browser extracted in /tmp/restheart-6936444083912439810 21:44:09.091 [main] INFO org.restheart.Bootstrapper - URL /browser bound to static resources browser. access manager: false 21:44:09.093 [main] INFO org.restheart.Bootstrapper - URL /_logic/ping bound to application logic handler org.restheart.handlers.applicationlogic.PingHandler. access manager: false 21:44:09.093 [main] INFO org.restheart.Bootstrapper - URL /_logic/roles bound to application logic handler org.restheart.handlers.applicationlogic.GetRoleHandler. access manager: false 21:44:09.211 [main] INFO org.restheart.Bootstrapper - Pid file /var/run/restheart--1441246088.pid 21:44:09.212 [main] INFO org.restheart.Bootstrapper - RESTHeart started 21:45:39.494 [XNIO-1 task-2] DEBUG o.r.handlers.RequestDispacherHandler - Call to getPipedHttpHandler(DOCUMENT, POST) can't find any PipedHttpHandler
in log you have
20:28:15.449 [main] INFO org.restheart.Bootstrapper - URL / bound to MongoDB resource *
it should be URL /data bound to MongoDB resource *
because in the shipped restheart.yml
# Use mongo-mounts to bind URls to mongodb resources using the out-of-the-box URL rewrite feature.
mongo-mounts:
- what: "*"
where: /data
double check your docker container. you can check if the configuration file is there with:
$ docker exec -it <name-of-your-container> /bin/bash
bash-4.3# cat /opt/restheart/etc/restheart.yml
Hello again, I am using now the configuration files restheart.yml and security.yml shipped with this repo, but still get the same issue. I manage to open blog and fetch data, but not post new blog entry.
If you want to run this with Docker more work is necessary. I'm now able to run it locally with Docker but I had to touch several files (e.g. the URL http://127.0.0.1:8080 is hardcoded everywhere while in my case docker runs at 192.168.99.100).
I'll update the project with some modifications to allow this running properly with Docker.
@greezlyk I added a docker-compose.yml which might help. Look at https://github.com/SoftInstigate/restheart-blog-example/blob/master/README.md#run-with-docker
Now everything works fine on my docker machine.
Thank you, it works for me now. In this case we have angular running inside docker restheart container. Could be more flexible if you put an external variable for resthear server in $http get post functions. So we can change the restheart ip address lately.
You still have URL / bound to MongoDB resource *
it must be URL /data bound to MongoDB resource *
this is set via mongo-mount
option in configuration file.
Hello The SoftInstigate Team!
Tried to use this example , instilled docker image and run locally. When I try to save new post I get "405 Method Not Allowed"