lms.env.json and edxapp

1,762 views
Skip to first unread message

Alma Collado

unread,
Feb 11, 2014, 7:15:13 AM2/11/14
to edx-...@googlegroups.com
Hey guys,

I need some help here. I have installed the environment following https://github.com/edx/edx-platform/pull/1991/files and I have created a Course in Studio, just to test my app, this way:

$ vagrant up --no-provision
$ ssh vag...@127.0.0.1 -p 2222
$ rake cms[dev,0.0.0.0:8001]


but now I can't preview it, the View Live button gives me:

Unable to connect
Pale Moon can't establish a connection to the server at localhost:8000.

I have tried to fix this adding 192.168.33.10  preview.localhost to my development machine's /etc/hosts file:

$ cat /etc/hosts
# Host Database
127.0.0.1   localhost
255.255.255.255 broadcasthost
...
$ # if preview.localhost doesn't already exist:
$ sudo bash -c "echo '192.168.33.10  preview.localhost' >> /etc/hosts"
$ cat /etc/hosts
# Host Database
127.0.0.1   localhost
255.255.255.255 broadcasthost
...
192.168.33.10  preview.localhost

But it is still not working. So I have read that I have to put the server name in the PREVIEW_LMS_BASE variable, found in the cms.env.json and lms.env.json files. BUT I CAN'T FIND THESE FILES!! In fact, I have tried to switch to the edxapp account and run the developer stack and I get:

Alma Collado@ALMA ~/edx-platform (master)
$ ssh vag...@127.0.0.1 -p 2222
vag...@127.0.0.1's password:
Welcome to Ubuntu 12.04 LTS (GNU/Linux 3.2.0-23-generic-pae i686)

 * Documentation:  https://help.ubuntu.com/
Welcome to your Vagrant-built virtual machine.
Last login: Tue Feb 11 11:03:25 2014 from 10.0.2.2
(edx-platform)vagrant@precise32:/opt/edx/edx-platform$ sudo su edxapp
Unknown id: edxapp
(edx-platform)vagrant@precise32:/opt/edx/edx-platform$ rake devstack[lms]
Node requirements unchanged, nothing to install
Ruby requirements unchanged, nothing to install
Python requirements unchanged, nothing to install
xmodule_assets common/static/xmodule
./manage.py lms --settings devstack preprocess_assets --traceback
Traceback (most recent call last):
  File "./manage.py", line 90, in <module>
    startup = importlib.import_module(edx_args.startup)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/opt/edx/edx-platform/lms/startup.py", line 8, in <module>
    settings.INSTALLED_APPS  # pylint: disable=W0104
  File "/home/vagrant/.virtualenvs/edx-platform/local/lib/python2.7/site-package
s/django/utils/functional.py", line 184, in inner
    self._setup()
  File "/home/vagrant/.virtualenvs/edx-platform/local/lib/python2.7/site-package
s/django/conf/__init__.py", line 42, in _setup
    self._wrapped = Settings(settings_module)
  File "/home/vagrant/.virtualenvs/edx-platform/local/lib/python2.7/site-package
s/django/conf/__init__.py", line 93, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/home/vagrant/.virtualenvs/edx-platform/local/lib/python2.7/site-package
s/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/opt/edx/edx-platform/lms/envs/devstack.py", line 5, in <module>
    from .aws import * # pylint: disable=wildcard-import, unused-wildcard-import

  File "/opt/edx/edx-platform/lms/envs/aws.py", line 113, in <module>
    with open(CONFIG_ROOT / CONFIG_PREFIX + "env.json") as env_file:
IOError: [Errno 2] No such file or directory: path(u'/opt/edx/lms.env.json')
asset preprocessing failed!
node_modules/.bin/coffee --compile `find lms/ cms/ common/ -type f -name *.coffe
e`

It says the same, that lms.env.json doesn't exist... It seems like I don't have a edxapp database, even if I:

(edx-platform)vagrant@precise32:/opt/edx/edx-platform$ sudo mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 36
Server version: 5.5.35-0ubuntu0.12.04.2 (Ubuntu)

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| test               |
+--------------------+
4 rows in set (0.03 sec)

mysql>

I don't have any edxapp database and I think I should have one, isn't it? Is this problem related with the lms.env.json file?
What is the problem? Do I have to install something else?

Thanks in advance!

Galen Johnson

unread,
Feb 11, 2014, 9:03:03 AM2/11/14
to edx-...@googlegroups.com
Have you tried following one of the sets of instructions in the wiki at https://github.com/edx/configuration/wiki?

=G=


Alma Collado

unread,
Feb 11, 2014, 11:14:51 AM2/11/14
to edx-...@googlegroups.com
No, I haven't...
Now my question is... if I follow the instructions for "Installing the edX developer stack" where do I have to create the devstack folder? Inside the edx-platform folder created when downloading the project with git clone https://github.com/edx/edx-platform.git? And... if I write:

mkdir devstack
cd devstack
curl https://raw.github.com/edx/configuration/master/vagrant/release/devstack/Vagrantfile > Vagrantfile
vagrant up

With this vagrant up instruction am I creating a new VM? I have already created the edx-platform VM...
(sorry, I'm new with all this)

Yarko Tymciurak

unread,
Feb 11, 2014, 12:38:07 PM2/11/14
to edx-...@googlegroups.com
Sorry ... forgot "reply-all" 

---------- Forwarded message ----------
From: Yarko Tymciurak
Date: Tue, Feb 11, 2014 at 10:32 AM
Subject: Re: [edx-code] Re: lms.env.json and edxapp
To: Alma Collado 





On Tue, Feb 11, 2014 at 10:14 AM, Alma Collado  wrote:
No, I haven't...
Now my question is... if I follow the instructions for "Installing the edX developer stack" where do I have to create the devstack folder? Inside the edx-platform folder created when downloading the project with git clone https://github.com/edx/edx-platform.git?

No.   edx-platform would be either automatically downloaded for you, or you can place it _in_ the devstack folder (the comments and ora repositories will also be downloaded for you), or you can put it someplace different - see "customizing the location of the source code" in that wiki.

And... if I write:

mkdir devstack
cd devstack
curl https://raw.github.com/edx/configuration/master/vagrant/release/devstack/Vagrantfile > Vagrantfile
vagrant up

With this vagrant up instruction am I creating a new VM? I have already created the edx-platform VM...
(sorry, I'm new with all this)

With devstack, you potentially are often creating and destroying VM's as part of development.

This VM will be for this directory.
Be careful to "vagrant destroy" any vagrant created VM's you will no longer use.  If you don't, you will find your disk space slowly getting consumed (think on the order of 5G per VM, or so).

Alma Collado

unread,
Feb 11, 2014, 3:21:02 PM2/11/14
to edx-...@googlegroups.com
Thanks!!

I'm following the instructions for "Installing the edX developer stack" but I don't know why when everything is supposed to be ok... all the folders are empty:

Alma Collado@ALMA ~/devstack
$ curl https://raw.github.com/edx/configuration/master/vagrant/release/devstack/Vagrantfile > Vagrantfile
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2369  100  2369    0     0   3611      0 --:--:-- --:--:-- --:--:--  3611

Alma Collado@ALMA ~/devstack
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
[default] Importing base box 'gugelhupf-devstack'...
[default] Matching MAC address for NAT networking...
[default] Clearing any previously set forwarded ports...
[default] Creating shared folders metadata...
[default] Clearing any previously set network interfaces...
[default] Preparing network interfaces based on configuration...
[default] Forwarding ports...
[default] -- 22 => 2222 (adapter 1)
[default] -- 8000 => 8000 (adapter 1)
[default] -- 8001 => 8001 (adapter 1)
[default] -- 4567 => 4567 (adapter 1)
[default] Running 'pre-boot' VM customizations...
[default] Booting VM...
[default] Waiting for machine to boot. This may take a few minutes...
[default] Machine booted and ready!
[default] Configuring and enabling network interfaces...
[default] Mounting shared folders...
[default] -- /vagrant
[default] -- /edx/app/ora/ora
[default] -- /edx/app/edxapp/edx-platform
[default] -- /edx/app/forum/cs_comments_service

Alma Collado@ALMA ~/devstack
$ vagrant ssh
Welcome to Ubuntu 12.04 LTS (GNU/Linux 3.2.0-23-generic x86_64)


 * Documentation:  https://help.ubuntu.com/
Welcome to your Vagrant-built virtual machine.
Last login: Mon Feb 10 14:08:41 2014 from 10.0.2.2
vagrant@precise64:~$ sudo su edxapp
edxapp@precise64:~/edx-platform$ rake devstack[lms]
rake aborted!
No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb)
/edx/app/edxapp/.gem/gems/rake-10.0.4/lib/rake/application.rb:584:in `raw_load_r
akefile'
/edx/app/edxapp/.gem/gems/rake-10.0.4/lib/rake/application.rb:89:in `block in lo
ad_rakefile'
/edx/app/edxapp/.gem/gems/rake-10.0.4/lib/rake/application.rb:160:in `standard_e
xception_handling'
/edx/app/edxapp/.gem/gems/rake-10.0.4/lib/rake/application.rb:88:in `load_rakefi
le'
/edx/app/edxapp/.gem/gems/rake-10.0.4/lib/rake/application.rb:72:in `block in ru
n'
/edx/app/edxapp/.gem/gems/rake-10.0.4/lib/rake/application.rb:160:in `standard_e
xception_handling'
/edx/app/edxapp/.gem/gems/rake-10.0.4/lib/rake/application.rb:70:in `run'
(See full trace by running task with --trace)
edxapp@precise64:~/edx-platform$


I don't know where is the problem know. I'm following the instructions but I only have empty folders:

Alma Collado@ALMA ~/devstack
$ ls
Vagrantfile  cs_comments_service  edx-platform  ora

Alma Collado@ALMA ~/devstack
$ ls vagrantfile
vagrantfile

Alma Collado@ALMA ~/devstack
$ ls cs_comments_service

Alma Collado@ALMA ~/devstack
$ ls edx-platform/

Alma Collado@ALMA ~/devstack
$ ls ora

Yarko Tymciurak

unread,
Feb 11, 2014, 3:51:24 PM2/11/14
to Alma Collado, edx-...@googlegroups.com
I am not sure why this is - there are either network timeouts, or something else (it seem to happen more frequently where internet service / speed or distance from main repositories is greater, but I experience it in Chicago with fast service also).

When first creating a box, if this happens, simply leave the VM running.

You can check status from the directory where you put the Vagrantfile - always run vagrant commands for that specific VM from that directory:

vagrant status

If it shows it "running", then resume provisioning your VM with:

vagrant provision

or, if it's not running, you can force provisioning with:

vagrant up --provision


Alma Collado

unread,
Feb 11, 2014, 4:34:04 PM2/11/14
to edx-...@googlegroups.com, Alma Collado

Well... I have seen that the VM was runing so I have tried with vagrant provision and when everything looked like fixed...

...
TASK: [edxapp | Updating requirement files for git mirror] ********************
changed: [localhost]
TASK: [edxapp | gem install bundler] ******************************************
changed: [localhost]
TASK: [edxapp | bundle install] ***********************************************
changed: [localhost]
TASK: [edxapp | Set the npm registry] *****************************************
skipping: [localhost]

TASK: [edxapp | Install edx-platform npm dependencies] ************************
failed: [localhost] => {"changed": true, "cmd": "npm install ", "delta": "0:00:
1.649824", "end": "2014-02-11 21:23:51.097696", "item": "", "rc": 1, "start": "
014-02-11 21:23:49.447872"}
stderr: npm http GET http://registry.npmjs.org/coffee-script
npm http 304 http://registry.npmjs.org/coffee-script
npm ERR! error installing coffee...@1.6.1

npm ERR! Error: UNKNOWN, unknown error '../coffee-script/bin/cake'
npm ERR! You may report this log at:
npm ERR!     <http://bugs.debian.org/npm>
npm ERR! or use
npm ERR!     reportbug --attach /edx/app/edxapp/edx-platform/npm-debug.log npm
npm ERR!
npm ERR! System Linux 3.2.0-23-generic
npm ERR! command "node" "/usr/bin/npm" "install"
npm ERR! cwd /edx/app/edxapp/edx-platform
npm ERR! node -v v0.6.12
npm ERR! npm -v 1.1.4
npm ERR! path ../coffee-script/bin/cake
npm ERR! code UNKNOWN
npm ERR! message UNKNOWN, unknown error '../coffee-script/bin/cake'
npm ERR! errno {}
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /edx/app/edxapp/edx-platform/npm-debug.log
npm not ok

FATAL: all hosts have already failed -- aborting

PLAY RECAP ********************************************************************

           to retry, use: --limit @/root/vagrant-devstack.retry

localhost                  : ok=107  changed=20   unreachable=0    failed=1

No error message

Alma Collado@ALMA ~/devstack
$

I have tried twice and I get the same error.

Thanks a lot for your help!

Yarko Tymciurak

unread,
Feb 11, 2014, 4:46:28 PM2/11/14
to Alma Collado, edx-...@googlegroups.com
What does this log say?  (it's on your VM - login with vagrant ssh;  you can then make easy work of copying it out of the VM to your workstation by copying to /vagrant/npm-debug.log --- this will put it in the same directory as your Vagrantfile).

If you want to share it so we can look through it, you could post it to a gist - http://gist.github.com (login to github, or create an account, then click "gist" and you can create a gist from there by dragging the log file to the "new gist" page).

Alma Collado

unread,
Feb 11, 2014, 7:09:16 PM2/11/14
to edx-...@googlegroups.com, Alma Collado
Great!

I have just posted it. Here is the link:

https://gist.github.com/SpaceDementia/8947141

Thanks

Yarko Tymciurak

unread,
Feb 11, 2014, 8:03:44 PM2/11/14
to Alma Collado, edx-...@googlegroups.com
Alma -

Question:   are you running this on Windows?

Could you login to your vagrant machine:  vagrant ssh
and then become the edxapp user:  sudo su edxapp
and then give us the output from:  ls -la

If you're running this on Windows, please see:

In that case, the problem may be that symlinks are not being created (which would explain this error, I think).

Alma Collado

unread,
Feb 12, 2014, 7:45:27 AM2/12/14
to edx-...@googlegroups.com, Alma Collado
Yes, I'm running this on Windows.
When and where do I have to run the symlinks? Because there it says "before running vagrant up" and "go to the root edx-platform folder" and if I go to my root folder (devstack) and try to run them I get:

 Alma Collado@ALMA ~/devstack
$ git rm --cached -r . && git reset --hard
fatal: Not a git repository (or any of the parent directories): .git

So I can't run them.
And this is what I get with the commands you told me:

Alma Collado@ALMA ~/devstack
$ vagrant ssh
Welcome to Ubuntu 12.04 LTS (GNU/Linux 3.2.0-23-generic x86_64)
*******************************************************************
*                                                                 *
*   _   _| |\ \/ /  This system is for the use of authorized      *
* / -_) _` | >  <   users only.  Usage of this system may be      *
* \___\__,_|/_/\_\  monitored and recorded by system personnel.   *
*                                                                 *
* Anyone using this system expressly consents to such monitoring  *
* and is advised that if such monitoring reveals possible         *
* evidence of criminal activity, system personnel may provide the *
* evidence from such monitoring to law enforcement officials.     *
*                                                                 *
*******************************************************************

Last login: Mon Feb 10 14:08:41 2014 from 10.0.2.2
vagrant@precise64:~$ sudo su edxapp
vagrant@precise64:~$ ls -la
total 56
drwxr-xr-x 5 vagrant vagrant 4096 Feb 10 03:19 .
drwxr-xr-x 3 root    root    4096 Sep 14  2012 ..
drwxrwxr-x 3 vagrant vagrant 4096 Feb 10 02:06 .ansible
-rw------- 1 vagrant vagrant   44 Feb 10 14:10 .bash_history
-rw-r--r-- 1 vagrant vagrant  220 Sep 14  2012 .bash_logout
-rw-r--r-- 1 vagrant vagrant 3512 Feb 10 03:19 .bashrc
drwx------ 2 vagrant vagrant 4096 Sep 14  2012 .cache
-rwxr-xr-x 1 vagrant vagrant 6487 Sep 14  2012 postinstall.sh
-rw-r--r-- 1 vagrant vagrant  675 Sep 14  2012 .profile
-rwx------ 1 vagrant vagrant  272 Feb 10 03:19 share_x11
drwx------ 2 vagrant vagrant 4096 Sep 14  2012 .ssh
-rw-r--r-- 1 vagrant vagrant    0 Sep 14  2012 .sudo_as_admin_successful
-rw------- 1 vagrant vagrant    6 Sep 14  2012 .vbox_version
-rw------- 1 vagrant vagrant   12 Sep 14  2012 .veewee_version
vagrant@precise64:~$

Yarko Tymciurak

unread,
Feb 12, 2014, 8:13:26 AM2/12/14
to Alma Collado, edx-...@googlegroups.com


On Feb 12, 2014 6:45 AM, "Alma Collado" <alma.c...@gmail.com> wrote:
>
> Yes, I'm running this on Windows.
> When and where do I have to run the symlinks? Because there it says "before running vagrant up" and "go to the root edx-platform folder" and if I go to my root folder (devstack) and try to run them I get:
>
>  Alma Collado@ALMA ~/devstack
> $ git rm --cached -r . && git reset --hard
> fatal: Not a git repository (or any of the parent directories): .git

When it says your root folder I believe it means the root of your git repository. I don't have windows so I'm guessing a little on the process here.

This seems to imply that in your devstack folder you will need to manually clone the three repositories  - edx-platform, edx-ora as ora, and cs_comments_service - so that you can run the above get commands.

I would guess you want to run those commands in the each of these. That certainly wouldn't hurt.

I hope this helps.

Reply all
Reply to author
Forward
0 new messages