cozy-labs / cozy-ghost

The ghost blogging platform for cozy
Other
3 stars 10 forks source link

App cannot be installed by self-hosted user #2

Closed jsilvestre closed 8 years ago

jsilvestre commented 9 years ago

@vaz-ar told me he didn't manage to install the application. He got the following log:

ERROR: Your site url in config.js is invalid. http://https/public/blog/ Please make sure this is a valid url before restarting

He has defined his domain in the settings.

vaz-ar commented 9 years ago

"full" log :

ERROR: Your site url in config.js is invalid.
 http://https/public/blog/
 Please make sure this is a valid url before restarting
 Error: Your site url in config.js is invalid.
    at ConfigManager.validate (/usr/local/cozy/apps/blog/server/ghost/core/server/config/index.js:325:25)
    at /usr/local/cozy/apps/blog/server/ghost/core/server/config/index.js:238:29
    at tryCatch1 (/usr/local/cozy/apps/blog/node_modules/bluebird/js/main/util.js:45:21)
    at Promise._callHandler (/usr/local/cozy/apps/blog/node_modules/bluebird/js/main/promise.js:571:13)
    at Promise._settlePromiseFromHandler (/usr/local/cozy/apps/blog/node_modules/bluebird/js/main/promise.js:581:18)
    at Promise._settlePromiseAt (/usr/local/cozy/apps/blog/node_modules/bluebird/js/main/promise.js:713:18)
    at Promise._settlePromiseAtPostResolution (/usr/local/cozy/apps/blog/node_modules/bluebird/js/main/promise.js:335:10)
    at Async._consumeFunctionBuffer (/usr/local/cozy/apps/blog/node_modules/bluebird/js/main/async.js:85:12)
    at Async.consumeFunctionBuffer (/usr/local/cozy/apps/blog/node_modules/bluebird/js/main/async.js:40:14)
    at process._tickDomainCallback (node.js:459:13)
frankrousseau commented 9 years ago

@cylwin @jsilvestre Someone complained about this on IRC yesterday. Could you add more information?

frankrousseau commented 9 years ago

+1 @cylwin @jsilvestre Someone complained on the forum. Could you add more information?

cylwin commented 9 years ago

I will try to fix this, this weekend.

vaz-ar commented 9 years ago

Is there any news about this ?

clochix commented 9 years ago

Hello @vaz-ar, According to https://github.com/cozy-labs/cozy-ghost/blob/master/server.js#L28 something seems to going wrong when getting the domain of your instance. Did you set a valid domain in the settings of your instance ?

martinsam commented 9 years ago

cozy-ghost standalone :

process.env.TOKEN undefined
process.env.NAME undefined
[2015-09-18 01:07:56:349] info - Cozy DB | blog - all request creation...
_http_outgoing.js:333
    throw new Error('"name" and "value" are required for setHeader().');
          ^
Error: "name" and "value" are required for setHeader().
    at ClientRequest.OutgoingMessage.setHeader (_http_outgoing.js:333:11)
    at new ClientRequest (_http_client.js:101:14)
    at Object.exports.request (http.js:49:10)
    at playRequest (/home/sam/www/cozy-ghost/node_modules/cozydb/node_modules/request-json-light/main.js:91:29)
    at Object.module.exports.put (/home/sam/www/cozy-ghost/node_modules/cozydb/node_modules/request-json-light/main.js:132:12)
    at JsonClient.put (/home/sam/www/cozy-ghost/node_modules/cozydb/node_modules/request-json-light/main.js:215:27)
    at Function.cozyRequestsAdapter.define (/home/sam/www/cozy-ghost/node_modules/cozydb/lib/cozymodel.js:237:21)
    at Function.Model.defineRequest (/home/sam/www/cozy-ghost/node_modules/cozydb/lib/model.js:184:42)
    at step (/home/sam/www/cozy-ghost/node_modules/cozydb/lib/index.js:139:20)
    at Object.module.exports.configure (/home/sam/www/cozy-ghost/node_modules/cozydb/lib/index.js:153:12)
node server.js                                                                                                                                                    [master] 
process.env.TOKEN undefined
process.env.NAME undefined
[2015-09-18 01:07:56:349] info - Cozy DB | blog - all request creation...
_http_outgoing.js:333
    throw new Error('"name" and "value" are required for setHeader().');
          ^
Error: "name" and "value" are required for setHeader().
    at ClientRequest.OutgoingMessage.setHeader (_http_outgoing.js:333:11)
    at new ClientRequest (_http_client.js:101:14)
    at Object.exports.request (http.js:49:10)
    at playRequest (/home/sam/www/cozy-ghost/node_modules/cozydb/node_modules/request-json-light/main.js:91:29)
    at Object.module.exports.put (/home/sam/www/cozy-ghost/node_modules/cozydb/node_modules/request-json-light/main.js:132:12)
    at JsonClient.put (/home/sam/www/cozy-ghost/node_modules/cozydb/node_modules/request-json-light/main.js:215:27)
    at Function.cozyRequestsAdapter.define (/home/sam/www/cozy-ghost/node_modules/cozydb/lib/cozymodel.js:237:21)
    at Function.Model.defineRequest (/home/sam/www/cozy-ghost/node_modules/cozydb/lib/model.js:184:42)
    at step (/home/sam/www/cozy-ghost/node_modules/cozydb/lib/index.js:139:20)
    at Object.module.exports.configure (/home/sam/www/cozy-ghost/node_modules/cozydb/lib/index.js:153:12)
aenario commented 9 years ago

Hi @martinsam, you are probably using nodejs 0.12 or more recent.

As for now, cozy and most of our apps are only compatibles with node 0.10.x, this is something we want to work on, but as for now, you will need to downgrade your nodejs installation.

vaz-ar commented 8 years ago

@clochix I added "https://" to my domain name and now it works. Thanks.

clochix commented 8 years ago

Thanks for the update @vaz-ar ☺

vaz-ar commented 8 years ago

After I installed it it worked until I rebooted my cozy, now it doesn't. I still get this error:

ERROR: Your site url in config.js is invalid. 
 http://https/public/blog/ 
 Please make sure this is a valid url before restarting 
 Error: Your site url in config.js is invalid.
clochix commented 8 years ago

Hi @vaz-ar, This look like the first error you encountered months ago. Could you check the domain inside the settings of your server?

vaz-ar commented 8 years ago

Are you talking about cozy's settings or thoses of the server ? I tried to change my server's hostname to the same value that is in my cozy, it doesn't change anything.

clochix commented 8 years ago

To check the domain registered in your server, could you try the following commands:

cozy-monitor curlcouch _design/cozyinstance/_view/all | json_pp | grep domain

and check that the answer is something like:

    "domain" : "cozy.vaz.ar"
vaz-ar commented 8 years ago

I just checked and yes it is set to the correct domain name.

clochix commented 8 years ago

In your server logs, you should see a line stating with domain. Is it domain: cozy.vaz.ar or just domain: https ? (see https://github.com/cozy-labs/cozy-ghost/blob/master/server.js#L27 )

vaz-ar commented 8 years ago

It is the correct domain, the same that I have set in the configuration page of my cozy.

clochix commented 8 years ago

Could you try to edit the server.js file in the application root directory, comment out the line domain = "http://" + domain; and try to restart the application ?