Closed webmst closed 8 years ago
Thanks!
I will update this ASAP
The user information should now be correct.
If you get 404 on API functions you probably do not have "mod_rewrite" enabled. Check that first -- since I have no problems on my end atm.
Also make sure you have "allow override" in your vhost so Apache can read .htaccess
mod_rewrite.so is loaded
'AllowOverride All' 'Require all granted'
are included.
But I haven't set the vhost yet, I'm using the 'osjs' alias to the 'dist' folder
After the above said modification of handler.php, it shows "demo" instead of "undefined", without taking into account the given mysql user
After the above said modification of handler.php, it shows "demo" instead of "undefined", without taking into account the given mysql user
Then the server is not running with the correct handler. I`m not having any problems with this locally and https://osjsv2.0o.no/ is running on Apache.
Did you change the handler according to the docs ? https://github.com/os-js/OS.js/blob/master/doc/mysql-handler.md
Just realized I had some typos in those docs -- fixed.
But, anyway. I just set up a fresh VM with PHP5 and Apache and used the docs to set up the mysql handler. I`m having no problems here :\
Yes, as I wrote at the beginning of this issue, the mysql-handler has been set according to the docs and with a php container, it displays the login screen and allows signing in (only wrong user is reported).
...but your modification to handler.php was on the 'demo' handler
Yeah. I remembered I forgot something that leads to the "undefined" problem, but that was only for demo handler, the mysql one has been updated by another user in the community and tested.
So the server is obviously using the wrong handler somehow -- a dead giveaway is that it says "demo" as username.
Sorry, but I cannot be of more assist at the moment -- I have to go to bed.
Sure, good night. I'm not in a hurry. We'll resume this next time.
As you posited I'm using the wrong handler for my mysql setup (that behaves differently using apache, php or node as containers), I re-executed the handler setup checking for error messages, finding the following output when 'grunt config' was executed:
Running "config" task
Writing configuration files...
[TypeError: Cannot read property 'homes' of undefined] 'TypeError: Cannot read property \'homes\' of undefined\n at buildServer (/usr/local/OS.js/src/build.js:807:59)\n at Object.createConfigurationFiles (/usr/local/OS.js/src/build.js:835:7)\n at Object.<anonymous> (/usr/local/OS.js/Gruntfile.js:227:14)\n at Object.thisTask.fn (/usr/local/OS.js/node_modules/grunt/lib/grunt/task.js:82:16)\n at Object.<anonymous> (/usr/local/OS.js/node_modules/grunt/lib/util/task.js:301:30)\n at Task.runTaskFn (/usr/local/OS.js/node_modules/grunt/lib/util/task.js:251:24)\n at Task.<anonymous> (/usr/local/OS.js/node_modules/grunt/lib/util/task.js:300:12)\n at Task.start (/usr/local/OS.js/node_modules/grunt/lib/util/task.js:309:5)\n at Object.grunt.tasks (/usr/local/OS.js/node_modules/grunt/lib/grunt.js:164:8)\n at Object.module.exports [as cli] (/usr/local/OS.js/node_modules/grunt/lib/grunt/cli.js:38:9)'
Done, without errors.
Can it help?
[TypeError: Cannot read property 'homes' of undefined] 'TypeError: Cannot read property \'homes\' of undefined\n
It seems that it has some trouble reading the settings file. So my guess is there's something wrong with yours.
What do you get when doing grunt config:get
?
Or more spesifically grunt config:get:server
I'm thinking that your src/conf/900-custom.json
file might be broken (which is the one generated when doing config via grunt) -- because I see no way of this happening on a clean setup.
Here is what you asked:
root@freenas:/usr/local/OS.js/doc # grunt config:get:server
Running "config:get:server" (config) task
Path: server
Type: string
handlers
Done, without errors.
Execution Time (2016-02-12 21:47:04 UTC)
loading tasks 50ms ââââ 8%
config:get:server 536ms âââââââââââââââââââââââââââââââââââââââ 90%
Total 594ms
root@freenas:/usr/local/OS.js # cat src/conf/900-custom.json
{
"repositories": [
"default",
"OS.js-extras",
"OS.js-expermimental",
"OS.js-submissions",
"OS.js-extras"
],
"handler": "mysql",
"server": "handlers",
"handlers": {
"mysql": {
"host": "localhost",
"user": "osjsuser",
"password": "osjspassword",
"database": "osjs"
}
}
}
Please note that I've already performed the new config setup as suggested in the just-modified mysql-handler.md (together with a git pull).
Your file is broken
"server": "handlers",
This was probablyu because of the typo I had, as which I corrected :( Sorry about that!
You should have something like.
{
"handler": "mysql",
"server": {
"handlers": {
"mysql": {
"host": "localhost",
"user": "osjs",
"password": "osjs",
"database": "osjs"
}
}
}
}
Please note that I've already performed the new config setup as suggested in the just-modified mysql-handler.md (together with a git pull).
That would not help if the 900 file has the error in it :)
Please note that I've already performed the new config setup as suggested in the just-modified mysql-handler.md (together with a git pull).
That would not help if the 900 file has the error in it :)
I know, I did it just to be sure there weren't any other modifications; your support can be effective only if we are in sync
Activating the mysql-handler I get 2 strange behaviours: