ERPNext 4 Installation Problem

664 views
Skip to first unread message

Robert Miller

unread,
Jul 31, 2014, 12:25:59 AM7/31/14
to erpnext-dev...@googlegroups.com

I have duplicated this problem several times, and hope you can help:

Fresh install of Centos 6.5 , 64 bit, Basic Server, on a VirtualBox VM hosted on OSX.

I issue the command to install frappe:

curl https://raw.githubusercontent.com/frappe/bench/master/install_scripts/setup_frappe.sh | sudo bash

and this terminates early where the mysql root password is being read:

Starting nginx: [ OK ] Starting memcached: [ OK ] Enter mysql root password to set: [root@test ~]#

The full log can be found here:

https://gist.githubusercontent.com/anonymous/21796f8da7ab285c93eb/raw/7b733f2466e67e1b76908ceb91cc372766a8bdb4/frappe-install-error


The script section relating to this is:

echo Enter mysql root password to set:
read -t 1 -n 10000 discard  || true
read -p "Enter mysql root password to set:" -s MSQ_PASS
mysqladmin -u root password $MSQ_PASS


I'm a newbie to Centos and erpnext but have a lot of IT experience in the mini/mainframe area,  and am at this point stumped.

I've been unsuccessful at all attempts to paste into the virtual console of the VM window (if anyone knows how to paste into a VirtualBox console on a Centos 6.5 install -- I've love to hear), so I ssh'ed into the VM and pasted the initial curl command line to do the install.  I did this from both iterm and the native terminal app on OSX, with the same results.  I have not


Any ideas ?


Pratik Vyas

unread,
Jul 31, 2014, 12:38:38 AM7/31/14
to erpnext-dev...@googlegroups.com
Hi Robert,

On Thu, Jul 31, 2014 at 9:55 AM, Robert Miller <keyer...@gmail.com> wrote:
>
> I have duplicated this problem several times, and hope you can help:
>
> Fresh install of Centos 6.5 , 64 bit, Basic Server, on a VirtualBox VM
> hosted on OSX.
>
> I issue the command to install frappe:
>
> curl
> https://raw.githubusercontent.com/frappe/bench/master/install_scripts/setup_frappe.sh
> | sudo bash
>
> and this terminates early where the mysql root password is being read:
>
> Starting nginx: [ OK ]
> Starting memcached: [ OK ]
> Enter mysql root password to set:
> [root@test ~]#
>
>
> The full log can be found here:
>
> https://gist.githubusercontent.com/anonymous/21796f8da7ab285c93eb/raw/7b733f2466e67e1b76908ceb91cc372766a8bdb4/frappe-install-error
>
>
> The script section relating to this is:
>
> echo Enter mysql root password to set:
> read -t 1 -n 10000 discard || true
> read -p "Enter mysql root password to set:" -s MSQ_PASS
> mysqladmin -u root password $MSQ_PASS
>
>
> I'm a newbie to Centos and erpnext but have a lot of IT experience in the
> mini/mainframe area, and am at this point stumped.
>

Thanks for the details :)
The issue is that on flushing the stdin with "read -t 1 -n 10000
discard || true" it is flushing the rest of the script being piped.

The fix is to download the script and run it. Would be great if you
try on a clean image.

wget https://raw.githubusercontent.com/frappe/bench/master/install_scripts/setup_frappe.sh
sudo bash setup_frappe.sh

(Updated the readme)

> I've been unsuccessful at all attempts to paste into the virtual console of
> the VM window (if anyone knows how to paste into a VirtualBox console on a
> Centos 6.5 install -- I've love to hear), so I ssh'ed into the VM and pasted
> the initial curl command line to do the install. I did this from both iterm
> and the native terminal app on OSX, with the same results. I have not
>

I don't think that's possible (if you're not running X ie the GUI). If
you are, you can use guest additions.

>
> Any ideas ?
>
>
> --
> Note:
>
> If you are posting an issue,
>
> 1. ERPNext is a free and open source software and support is given on this
> forum by a team (https://frappe.io/webnotes). So please consider donating if
> you find this forum useful (https://frappe.io/buy). Even a small amount
> would be helpful.
> 2. We should be able to replicate it at our end. So please give us as much
> information as you can. Please see it from the point of view of the person
> receiving the communication.
> 3. Paste your code at http://pastebin.com or http://gist.github.com and send
> only the URL via email
> 4. For sending images, use http://imgur.com or other similar services. Do
> not send images as attachments. Links are good. Same goes for any file you
> are going to send.
>
> End of Note
> ---
> You received this message because you are subscribed to the Google Groups
> "ERPNext Developer Forum" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to erpnext-developer...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/erpnext-developer-forum/5deeccbc-79c2-439a-b76c-f78d32445ee5%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.


Thanks,
--
Pratik
erpnext

Robert Miller

unread,
Jul 31, 2014, 1:20:01 AM7/31/14
to erpnext-dev...@googlegroups.com
Thank you Pratik your explanation to the problem:


I downloaded the file, then executed, on a fresh install, and got the following error:

ERROR: certificate common name “www.github.com” doesn’t match requested host name “raw.githubusercontent.com”.
To connect to raw.githubusercontent.com insecurely, use ‘--no-check-certificate’.

I added '--no-check-certificate’ to the wget and got the following error:


Starting supervisord:
Starting MySQL..                                           [  OK  ]
Starting redis-server:                                     [  OK  ]

Starting nginx:                                            [  OK  ]
Starting memcached:                                        [  OK  ]
Enter mysql root password to set:
Enter mysql root password to set:bash: line 0: cd: /home/root: No such file or directory
[root@test ~]#

I tried the bench command to see if the above error was significant, and got the following result:

[root@test ~]# bench init frappe-bench && cd frappe-bench
-bash: bench: command not found
[root@test ~]#

The full log after receiving your recommendations is here:

https://gist.github.com/992403b01fae138a74f4.git





I don't think that's possible (if you're not running X ie the GUI). If
you are, you can use guest additions.



Thank you for the suggestion on using guest additions if one is running X, which I will not be able to do in the final headless install, so I was hoping there was another solution.


Any other idea options to try ?


 

Robert Miller

unread,
Jul 31, 2014, 1:22:59 AM7/31/14
to erpnext-dev...@googlegroups.com
Correct link to latest log file is:

https://gist.github.com/anonymous/992403b01fae138a74f4

Pratik Vyas

unread,
Jul 31, 2014, 2:04:22 AM7/31/14
to erpnext-dev...@googlegroups.com
> --
> Note:
>
> If you are posting an issue,
>
> 1. ERPNext is a free and open source software and support is given on this
> forum by a team (https://frappe.io/webnotes). So please consider donating if
> you find this forum useful (https://frappe.io/buy). Even a small amount
> would be helpful.
> 2. We should be able to replicate it at our end. So please give us as much
> information as you can. Please see it from the point of view of the person
> receiving the communication.
> 3. Paste your code at http://pastebin.com or http://gist.github.com and send
> only the URL via email
> 4. For sending images, use http://imgur.com or other similar services. Do
> not send images as attachments. Links are good. Same goes for any file you
> are going to send.
>
> End of Note
> ---
> You received this message because you are subscribed to the Google Groups
> "ERPNext Developer Forum" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to erpnext-developer...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/erpnext-developer-forum/7748e3ea-c713-46e6-9db7-c06cd519546b%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.

The script was supposed to create a user 'frappe' which it didn't.

Run the following commads as root,

```
useradd -m -d /home/frappe -s $SHELL frappe
su frappe -c "cd /home/frappe && git clone
https://github.com/frappe/bench bench-repo"
pip install -e /home/frappe/bench-repo
```

Then login as frappe with the command, 'su - frappe'

and proceed to setup the bench.

Thanks for the bug report!

--
Pratik
erpnext

Robert Miller

unread,
Jul 31, 2014, 2:41:18 PM7/31/14
to erpnext-dev...@googlegroups.com

Thank you Pratik

   Your suggestions worked perfectly.

    The PDF's are very nice!

Robert

Peter Schmidler

unread,
Sep 27, 2014, 2:34:04 PM9/27/14
to erpnext-dev...@googlegroups.com
Had the same issue and it helped!
Any plans fixing the issue in https://github.com/frappe/bench or adding the commands to the documentation?
Bst, PS

Pratik Vyas

unread,
Sep 27, 2014, 2:40:47 PM9/27/14
to erpnext-dev...@googlegroups.com
On Sun, Sep 28, 2014 at 12:04 AM, Peter Schmidler
<petersc...@gmail.com> wrote:
> Had the same issue and it helped!
> Any plans fixing the issue in https://github.com/frappe/bench or adding the
> commands to the documentation?
> Bst, PS
>

Hi Peter,

Somehow, I am not able to replicate it.

https://github.com/frappe/bench/blob/master/install_scripts/setup_frappe.sh#L105

This if condition should have evaluated to true but doesn't in this
case. Any clues?

Thanks,
--
Pratik
erpnext

Peter Schmidler

unread,
Sep 27, 2014, 6:00:05 PM9/27/14
to erpnext-dev...@googlegroups.com
Hi Pratik,

it does happen on a fresh digital ocean Ubuntu 14.04 x64 box after logging in via ssh as root end entering:

$ wget https://raw.githubusercontent.com/frappe/bench/master/install_scripts/setup_frappe.sh
$ sudo bash setup_frappe.sh

I get this error message: bash: line 0: cd: /home/root: No such file or directory
Here's the complete log: http://pastebin.com/ztdc17Bx

Than I tried to follow your instructions from before. (I added the "passwd frappe" step though).

$ useradd -m -d /home/frappe -s $SHELL frappe
$ passwd frappe
$ su frappe -c "cd /home/frappe && git clone https://github.com/frappe/bench bench-repo"
$ pip install -e /home/frappe/bench-repo
# Complete log: http://pastebin.com/VmvKrGcg
$ su - frappe

Then I proceeded with the instructions from https://github.com/frappe/bench.

$ cd ~
$ bench init frappe-bench
$ cd frappe-bench
$ bench get-app erpnext https://github.com/frappe/erpnext
$ bench new-site site1.local
$ bench frappe --install_app erpnext site1.local

$ bench setup supervisor
$ sudo ln -s `pwd`/config/supervisor.conf /etc/supervisor/conf.d/frappe.conf
# I get this message: frappe is not in the sudoers file. This incident will be reported.
$ bench setup nginx
$ sudo ln -s `pwd`/config/nginx.conf /etc/nginx/conf.d/frappe.conf
# I get this message: frappe is not in the sudoers file. This incident will be reported.

When I now enter the IP of the box I see the "Welcome to nginx!" page.

Am I missing something?
How can I now access the app?
What about the "frappe is not in the sudoers file. ..."
It would be cool to have an easy, documented way of getting ERPnext running on DO.

Thanks for your help!

Bst, PS

Pratik Vyas

unread,
Sep 28, 2014, 7:07:48 AM9/28/14
to erpnext-dev...@googlegroups.com
> $ bench setup supervisor
> $ sudo ln -s `pwd`/config/supervisor.conf /etc/supervisor/conf.d/frappe.conf
> # I get this message: frappe is not in the sudoers file. This incident will be reported.
> $ bench setup nginx
> $ sudo ln -s `pwd`/config/nginx.conf /etc/nginx/conf.d/frappe.conf
> # I get this message: frappe is not in the sudoers file. This incident will be reported.
>
> When I now enter the IP of the box I see the "Welcome to nginx!" page.
>
> Am I missing something?
> How can I now access the app?
> What about the "frappe is not in the sudoers file. ..."
> It would be cool to have an easy, documented way of getting ERPnext running on DO.
>
> Thanks for your help!
>
> Bst, PS

Hi Peter,

It seems that the production setup steps don't work for you. Run the
following commands as root,

```
rm /etc/nginx/sites-available/default
ln -s `pwd`/config/supervisor.conf /etc/supervisor/conf.d/frappe.conf
ln -s `pwd`/config/nginx.conf /etc/nginx/conf.d/frappe.conf
supervisorctl reload
service nginx reload
```

The guide is divided two parts, getting and setting up the bench and
production deployment. We can make a consolidated one, maybe in the
digitalocean wiki too.

--
Pratik
erpnext

Peter Schmidler

unread,
Sep 28, 2014, 8:07:05 AM9/28/14
to erpnext-dev...@googlegroups.com
In https://github.com/frappe/bench/blob/master/README.md it says: sudo bash setup_frappe.sh

# Check if script is running as root and is not running as sudo. We want to skip
# this step if the user is already running this script with sudo as a non root user

Should we possibly run the bash script without sudo?

Bst PS

Peter Schmidler

unread,
Sep 28, 2014, 8:35:56 AM9/28/14
to erpnext-dev...@googlegroups.com
Ok, let's do a consolidated one! Any help is highly appreciated.

I have succeeded (partially) with the installation by following this https://github.com/frappe/bench/blob/master/README.md

I had to apply some changes to the instruction, though:

1. I stripped the sudo at the installation bash script "bash setup_frappe.sh"
2. I stripped the sudos at the symlinks of ngnix and supervisor
3. I added "rm /etc/nginx/sites-available/default" before the ngnix restart.
4. I added "supervisorctl reload" and "service nginx reload"

There are some questions that remain for me:

1. Is there a better/more secure way than doing the installation as root?
2. Is the step "sudo bench setup sudoers $(whoami)" necessary, the sudo be stripped, too, right?
3. After the installation I see the login page but the files in the "lib" and "assets" folders return 404s.

My current installation procedure is as follows:
  • bench new-site site1.local
  • bench frappe --install_app erpnext site1.local
  • bench setup supervisor
  • ln -s `pwd`/config/supervisor.conf /etc/supervisor/conf.d/frappe.conf # before: sudo ...
  • supervisorctl reload # new
  • sudo bench setup sudoers $(whoami) # strip the sudo, too?
  • bench setup nginx
  • ln -s `pwd`/config/nginx.conf /etc/nginx/conf.d/frappe.conf # before: sudo ...
  • rm /etc/nginx/sites-available/default  # new
  • service nginx reload # new

Pratik Vyas

unread,
Sep 28, 2014, 8:45:27 AM9/28/14
to erpnext-dev...@googlegroups.com
Hi Peter,

Replies inline..

> 1. Is there a better/more secure way than doing the installation as root?

Things that happen as root,
* Installation of packages (almost everything in setup_frappe.sh)
* linking of supervisor and nginx configs
* setting up of sudoers file to make restart of supervisor process passwordless

> 2. Is the step "sudo bench setup sudoers $(whoami)" necessary, the sudo be
> stripped, too, right?

Basically, this and only this bench command should be run as
superuser. It creates a sudoers file that makes `sudo supervisorctl
restart frappe:` command passwordless.

> 3. After the installation I see the login page but the files in the "lib"
> and "assets" folders return 404s.

What's in the nginx logs (/var/logs/nginx/)? If you get permission error, try
```
chmod o+x /home/frappe
chmod g+x /home/frappe
```

All bench commands (except sudoers one) are to be run as frappe user
and not root or using sudo.

Thanks,
--
Pratik
erpnext

Peter Schmidler

unread,
Sep 28, 2014, 10:42:42 AM9/28/14
to erpnext-dev...@googlegroups.com
Hi Pratik,

Am 28.09.2014 um 14:45 schrieb Pratik Vyas <pdv...@gmail.com>:

>> What's in the nginx logs (/var/logs/nginx/)? If you get permission error, try
> ```
> chmod o+x /home/frappe
> chmod g+x /home/frappe
> ```

I tried these commands and only the bin 404 disappeared.

Here's my Ngnix error log.

http://pastebin.com/hpG7bpiT

Thanks!

PS

Pratik Vyas

unread,
Sep 28, 2014, 10:54:02 AM9/28/14
to erpnext-dev...@googlegroups.com
I see that your bench is in /root

It should be in /home/frappe owned by frappe user.

What is the output of `which bench` ?

--
Pratik
erpnext

Peter Schmidler

unread,
Sep 28, 2014, 10:56:37 AM9/28/14
to erpnext-dev...@googlegroups.com
> What is the output of `which bench` ?

/usr/local/bin/bench

Peter Schmidler

unread,
Sep 28, 2014, 11:03:42 AM9/28/14
to erpnext-dev...@googlegroups.com
So the first thing I would do on a fresh ubuntu box would be to cretae a frappe user, right?

Am 28.09.2014 um 14:45 schrieb Pratik Vyas <pdv...@gmail.com>:

> --
> 1. Please be kind and don't send large attachments
> 2. For issues, features requests use https://github.com/frappe/erpnext/issues
> ---
> You received this message because you are subscribed to a topic in the Google Groups "ERPNext Developer Forum" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/erpnext-developer-forum/Wc9gUbKzMwg/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to erpnext-developer...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/CAG8U0Ek-dzx9SHv-jcY_qFET%3Dk_0tfYpGUvE9krv%2BLSxxeDcBA%40mail.gmail.com.

Peter Schmidler

unread,
Sep 28, 2014, 11:12:48 AM9/28/14
to erpnext-dev...@googlegroups.com
So this is my new setup instructions.
Will refine and try again on a fresh box, tomorrow.

• wget https://raw.githubusercontent.com/frappe/bench/master/install_scripts/setup_frappe.sh
• bash setup_frappe.sh # if sudo no frappe user will be created
• # give frappe user a password and switch to frappe user
• cd ~
• bench init frappe-bench
• cd frappe-bench
• bench get-app erpnext https://github.com/frappe/erpnext
• bench new-site site1.local
• bench frappe --install_app erpnext site1.local
• bench setup supervisor
• sudo ln -s `pwd`/config/supervisor.conf /etc/supervisor/conf.d/frappe.conf
• supervisorctl reload # new
• sudo bench setup sudoers $(whoami)
• bench setup nginx
• sudo ln -s `pwd`/config/nginx.conf /etc/nginx/conf.d/frappe.conf
• rm /etc/nginx/sites-available/default # new
• service nginx reload # new

> --
> 1. Please be kind and don't send large attachments
> 2. For issues, features requests use https://github.com/frappe/erpnext/issues
> ---
> You received this message because you are subscribed to a topic in the Google Groups "ERPNext Developer Forum" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/erpnext-developer-forum/Wc9gUbKzMwg/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to erpnext-developer...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/CAG8U0E%3DswK2GLGs%2BKgeV%3DJvpWPF0MiaVKDyiENqutbOQwqnVNg%40mail.gmail.com.

Pratik Vyas

unread,
Sep 28, 2014, 11:19:08 AM9/28/14
to erpnext-dev...@googlegroups.com
On Sun, Sep 28, 2014 at 8:42 PM, Peter Schmidler
<petersc...@gmail.com> wrote:
> So this is my new setup instructions.
> Will refine and try again on a fresh box, tomorrow.
>
> * wget https://raw.githubusercontent.com/frappe/bench/master/install_scripts/setup_frappe.sh
> * bash setup_frappe.sh # if sudo no frappe user will be created
> * # give frappe user a password and switch to frappe user
> * cd ~
> * bench init frappe-bench
> * cd frappe-bench
> * bench get-app erpnext https://github.com/frappe/erpnext
> * bench new-site site1.local
> * bench frappe --install_app erpnext site1.local
> * bench setup supervisor
> * sudo ln -s `pwd`/config/supervisor.conf /etc/supervisor/conf.d/frappe.conf
> * supervisorctl reload # new
> * sudo bench setup sudoers $(whoami)
> * bench setup nginx
> * sudo ln -s `pwd`/config/nginx.conf /etc/nginx/conf.d/frappe.conf
> * rm /etc/nginx/sites-available/default # new
> * service nginx reload # new
>

Great, was about to suggest starting afresh.

Also, updating your instructions,

As root,

* wget
https://raw.githubusercontent.com/frappe/bench/master/install_scripts/setup_frappe.sh
* bash setup_frappe.sh # if sudo no frappe user will be created
* # give frappe user a password and switch to frappe user

As frappe,

* cd ~
* bench init frappe-bench
* cd frappe-bench
* bench get-app erpnext https://github.com/frappe/erpnext
* bench new-site site1.local
* bench frappe --install_app erpnext site1.local
* bench setup supervisor
* bench setup nginx

Switch to root,


* cd /home/frappe/frappe-bench && bench setup sudoers frappe
* sudo ln -s `pwd`/config/nginx.conf
/etc/nginx/conf.d/frappe.conf
* sudo ln -s `pwd`/config/supervisor.conf
/etc/supervisor/conf.d/frappe.
conf
* rm /etc/nginx/sites-available/default # new
* supervisorctl reload # new
* service nginx reload # new


Looks good ?


--
Pratik
erpnext

Peter Schmidler

unread,
Sep 29, 2014, 1:51:10 PM9/29/14
to erpnext-dev...@googlegroups.com
Cool, thanks Pratnik! It worked flawlessly!
Reply all
Reply to author
Forward
0 new messages