SoftInstigate / restheart

Rapid API Development with MongoDB
https://restheart.org
GNU Affero General Public License v3.0
807 stars 171 forks source link

HAL user interface does not run #96

Closed caporossi closed 8 years ago

caporossi commented 8 years ago

RESTHeart 1.1.3 Mongodb 3.2

all installed in windows 8.1

json interface works correctly

HAL user interface does not appear, at http://127.0.0.1:8080/browser

Ciao

mkjsix commented 8 years ago

Hi, Are you building it on your own? In this case you might have forgotten to include the HAL Browser submodule before: https://github.com/SoftInstigate/restheart#how-to-build-it

caporossi commented 8 years ago

Hi the first attempt was made using the file found here https://github.com/SoftInstigate/restheart/releases/download/1.1.3/restheart-1.1.3.zip

the second attempt cloning the project and then executing $ Git submodule update --init --recursive $ Mvn clean package

the result is the same

the REST interface works well but does not appear HAL user interface at http://127.0.0.1:8080/browser

Ciao

mkjsix commented 8 years ago

I downloaded the same ZIP file and uncompressed it. It works for me (Mac OSX).

This is what I did:

$ cd restheart-1.1.3

$ java -server -jar restheart.jar 

15:59:52.379 [main] INFO  org.restheart.Bootstrapper - Starting RESTHeart
15:59:52.385 [main] INFO  org.restheart.Bootstrapper - version 1.1.3
15:59:52.393 [main] INFO  org.restheart.Bootstrapper - Logging to /var/folders/pk/56szmnfn5zlfxh2x6tkd5wqw0000gn/T/restheart.log with level INFO
15:59:52.394 [main] INFO  org.restheart.Bootstrapper - Logging to console with level INFO
15:59:52.757 [main] INFO  org.restheart.Bootstrapper - MongoDB connection pool initialized
15:59:52.757 [main] INFO  org.restheart.Bootstrapper - MongoDB version 3.0.7
15:59:52.757 [main] WARN  org.restheart.Bootstrapper - ***** No identity manager specified. authentication disabled.
15:59:52.757 [main] WARN  org.restheart.Bootstrapper - ***** No access manager specified. users can do anything.
15:59:52.758 [main] INFO  org.restheart.Bootstrapper - Token based authentication enabled with token TTL 15 minutes
15:59:53.063 [main] INFO  org.restheart.Bootstrapper - HTTPS listener bound at 0.0.0.0:4443
15:59:53.064 [main] INFO  org.restheart.Bootstrapper - HTTP listener bound at 0.0.0.0:8080
15:59:53.066 [main] INFO  org.restheart.Bootstrapper - Local cache for db and collection properties enabled
15:59:53.131 [main] INFO  org.restheart.Bootstrapper - URL / bound to MongoDB resource *
15:59:53.278 [main] INFO  org.restheart.Bootstrapper - Embedded static resources browser extracted in /var/folders/pk/56szmnfn5zlfxh2x6tkd5wqw0000gn/T/restheart-721672425989387685
15:59:53.312 [main] INFO  org.restheart.Bootstrapper - URL /browser bound to static resources browser. access manager: false
15:59:53.602 [main] INFO  org.restheart.Bootstrapper - Pid file /var/folders/pk/56szmnfn5zlfxh2x6tkd5wqw0000gn/T/restheart-0.pid
15:59:53.603 [main] INFO  org.restheart.Bootstrapper - RESTHeart started

Do you see the same Embedded static resources browser extracted in log entry? Could you copy here the startup logs as well? Which Browser are you using, by the way?

mkjsix commented 8 years ago

Additionally, could you please confirm you can see our public instance here: http://dbapi.io/browser/#/db/coll

caporossi commented 8 years ago

sorry for the delay

It is not a browser problem here you can see the screenshot of http://dbapi.io/browser/#/db/coll hal_1

attached you can find the log file

restheart.zip

and other screenshots that can help you to understand where the problem is. hal_2 hal_3 hal_4 hal_5

I found in C: \ Users \ gcaporossi \ AppData \ Local \ Temp \ restheart-1138963426701355955 a folder containing Hal browser but for some reason does not work.

how do you see the rest interface works fine.

thank you

mkjsix commented 8 years ago

I downloaded your restheart.zip file but it's only 22 bytes and looks empty. Could you please copy and paste here the initial few lines of the restheart's log? From "Starting RESTHeart" to "RESTHeart started".

It looks like a Windows specific issue, but that's weird and we're trying to reproduce it locally.

ujibang commented 8 years ago

Hi @caporossi

question: what does restheart return requesting http://127.0.0.1:8080/browser? Is it NOT FOUND, OK with empty response or other?

caporossi commented 8 years ago

Hi @mkjsix below you can find the log file

10:08:16.844 [main] INFO  org.restheart.Bootstrapper - Starting RESTHeart
10:08:16.848 [main] INFO  org.restheart.Bootstrapper - version 1.2.0-SNAPSHOT
10:08:16.850 [main] INFO  org.restheart.Bootstrapper - Logging to C:\Users\GCAPOR~1\AppData\Local\Temp\\restheart.log with level INFO
10:08:16.850 [main] INFO  org.restheart.Bootstrapper - Logging to console with level INFO
10:08:17.063 [main] INFO  org.restheart.Bootstrapper - MongoDB connection pool initialized
10:08:17.064 [main] INFO  org.restheart.Bootstrapper - MongoDB version 3.2.1
10:08:17.064 [main] WARN  org.restheart.Bootstrapper - ***** No identity manager specified. authentication disabled.
10:08:17.065 [main] WARN  org.restheart.Bootstrapper - ***** No access manager specified. users can do anything.
10:08:17.065 [main] INFO  org.restheart.Bootstrapper - Token based authentication enabled with token TTL 15 minutes
10:08:17.187 [main] INFO  org.restheart.Bootstrapper - HTTPS listener bound at 0.0.0.0:4443
10:08:17.187 [main] INFO  org.restheart.Bootstrapper - HTTP listener bound at 0.0.0.0:8080
10:08:17.188 [main] INFO  org.restheart.Bootstrapper - Local cache for db and collection properties enabled with TTL 1000 msecs
10:08:17.189 [main] INFO  org.restheart.Bootstrapper - Local cache for schema stores not enabled
10:08:17.258 [main] INFO  org.restheart.Bootstrapper - URL / bound to MongoDB resource *
10:08:17.335 [main] INFO  org.restheart.Bootstrapper - Embedded static resources browser extracted in C:\Users\GCAPOR~1\AppData\Local\Temp\restheart-6993791002747932008
10:08:17.346 [main] INFO  org.restheart.Bootstrapper - URL /browser bound to static resources browser. access manager: false
10:08:17.424 [main] INFO  org.restheart.Bootstrapper - RESTHeart started

Hi @ujibang at http://127.0.0.1:8080/browser i have an empty resonse if I try a path that does not exist for example http://127.0.0.1:8080/brooooowser the response is { "_links" : { "self" : { "href" : "/brooooowser"}} , "http status code" : 404 , "http status description" : "Not Found" , "message" : "Db 'brooooowser' does not exist"}

ciao

mkjsix commented 8 years ago

My only hypothesis so far is that some of the extracted files have a too long filesystem path

In the Windows API the maximum length for a path is MAX_PATH, which is defined as 260 characters

Could you please try extracting restheart.zip directly under C:\ and verify is something changes? I'd like to test if it's really a path issue or not.

Additionally, I also suggest opening the Chrome's Javascript console and have a look at any error message when loading the HAL Browser

caporossi commented 8 years ago

Sorry for the delay but these days are really busy!!!

I copied RestHeart in c: / but the result does not change.

in Chrome's Javascript console when I call the url http://127.0.0.1:8080/browser I have this result Request headers GET /browser HTTP/1.1 Host: 127.0.0.1:8080 Connection: keep-alive Cache-Control: max-age=0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8 Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.111 Safari/537.36 Accept-Encoding: gzip, deflate, sdch Accept-Language: it,en;q=0.8,en-US;q=0.6

Response headers HTTP/1.1 404 Not Found Connection: keep-alive Content-Length: 0 Date: Tue, 19 Jan 2016 20:56:45 GMT

as you can see, the response is 404 but the content-lenght is 0 and the page is blank

I call the url http://127.0.0.1:8080/browserother I have this result Request headers GET /browserother HTTP/1.1 Host: 127.0.0.1:8080 Connection: keep-alive Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8 Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.111 Safari/537.36 Accept-Encoding: gzip, deflate, sdch Accept-Language: it,en;q=0.8,en-US;q=0.6

Response headers HTTP/1.1 404 Not Found Content-Encoding: gzip X-Powered-By: restheart.org Access-Control-Expose-Headers: Location, ETag, Auth-Token, Auth-Token-Valid-Until, Auth-Token-Location, X-Powered-By Date: Tue, 19 Jan 2016 21:06:46 GMT Connection: keep-alive Access-Control-Allow-Origin: * Access-Control-Allow-Credentials: true Content-Type: application/hal+json Content-Length: 139 Request Headers view parsed

as you can see, the response is 404 but the content-lenght is 139 and the page show { "_links" : { "self" : { "href" : "/browserother"}} , "http status code" : 404 , "http status description" : "Not Found" , "message" : "Db 'browserother' does not exist"}

it seems that the web server of RestHeart can not map the virtual directory "/ browser" on the temporary folder generated in C: \ Users \ gcaporossi \ AppData \ Local \ Temp \ restheart-4020986507088336037

Ciao

ujibang commented 8 years ago

I noticed in the log the message

Embedded static resources browser extracted in C:\Users\GCAPOR~1\AppData\Local\Temp\restheart-6993791002747932008

but I guess the files are actually in:

 C: \Users\gcaporossi\AppData\ Local\Temp\restheart-6993791002747932008 

so GCAPOR~1 should be gcaporossi

@caporossi my suggestion is setting the environment variable %TEMP% property and try again.

also according to this stackoverflow answer you can try running restheart with -Djava.io.tmpdir=C:\Temp option

caporossi commented 8 years ago

hi I first changed the environment variable % TEMP% in c:/Windows/temp but not work, I think a problem of acess.

I finally created a directory in c:/Temp and set the environment variable%TEMP% in c:/Temp

in this folder all users have read and write and now everything is working correctly.

thank you

Gianluca