Error migrating site

118 views
Skip to first unread message

CJ

unread,
Jul 31, 2014, 4:30:18 AM7/31/14
to erpnext-dev...@googlegroups.com
I am following the migrating guide.

When I run "bench migrate-3to4 /path/to/old/erpnext/folder" (of course I replace with my correct path)
I have this error "subprocess.CalledProcessError: Command 'env/bin/python /opt/erpnext/bench-repo/bench/migrate3to4.py /opt/erpnext' returned non-zero exit status 127

What should I do?

Pratik Vyas

unread,
Jul 31, 2014, 4:56:08 AM7/31/14
to erpnext-dev...@googlegroups.com
What is the rest of the error? Must have printed above this.
> What should I do?
>
> --
> 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/533e4080-d507-4da0-a528-87bdc38afcb7%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Pratik
erpnext

CJ

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

Pratik Vyas

unread,
Jul 31, 2014, 5:05:18 AM7/31/14
to erpnext-dev...@googlegroups.com
The stacktrace I am looking for is above that.
>> > email to erpnext-developer...@googlegroups.com.
>> > To view this discussion on the web visit
>> >
>> > https://groups.google.com/d/msgid/erpnext-developer-forum/533e4080-d507-4da0-a528-87bdc38afcb7%40googlegroups.com.
>> > For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
>> --
>> Pratik
>> erpnext
>
> --
> 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/f8e17ad1-3eda-49e1-9219-eb28d74b0c8a%40googlegroups.com.

CJ

unread,
Jul 31, 2014, 5:32:43 AM7/31/14
to erpnext-dev...@googlegroups.com
Traceback (most recent call last):
  File "/opt/erpnext/bench-repo/bench/migrate3to4.py", line 98, in <module>
    main(args.site)
  File "/opt/erpnext/bench-repo/bench/migrate3to4.py", line 37, in main
    site = copy_site(path)
  File "/opt/erpnext/bench-repo/bench/migrate3to4.py", line 47, in copy_site
    raise Exception("Site already exists")
Exception: Site already exists
Error: None
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 9, in <module>
    load_entry_point('bench==0.1', 'console_scripts', 'bench')()
  File "/opt/erpnext/bench-repo/bench/cli.py", line 26, in cli
    return bench()
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 488, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 474, in main
    self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 758, in invoke
    return self.invoke_subcommand(ctx, cmd, cmd_name, ctx.args[1:])
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 767, in invoke_subcommand
    return cmd.invoke(cmd_ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 659, in invoke
    ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 325, in invoke
    return callback(*args, **kwargs)
  File "/opt/erpnext/bench-repo/bench/cli.py", line 117, in migrate_3to4
    site=path))
  File "/opt/erpnext/bench-repo/bench/utils.py", line 50, in exec_cmd
    subprocess.check_call(cmd, cwd=cwd, shell=True)
  File "/usr/lib/python2.7/subprocess.py", line 511, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'env/bin/python /opt/erpnext/bench-repo/bench/migrate3to4.py /opt/erpnext' returned non-zero exit status 1


Pratik Vyas

unread,
Jul 31, 2014, 5:39:38 AM7/31/14
to erpnext-dev...@googlegroups.com
I assume that the site was copied. Still, to be on the safe side run
the following, If any error occours please post complete output and
traceback.

Run,

bench update --pull
mv sites/erpnext /tmp/old_erpnext
bench migrate-3to4 /opt/erpnext

from the new bench

Thanks,
--
Pratik
erpnext

CJ

unread,
Jul 31, 2014, 9:48:33 PM7/31/14
to erpnext-dev...@googlegroups.com
Hi I did the 3 commands, and I still get the exact error.

Pratik Vyas

unread,
Aug 1, 2014, 12:21:20 AM8/1/14
to erpnext-dev...@googlegroups.com
On Fri, Aug 1, 2014 at 7:18 AM, CJ <joven...@gmail.com> wrote:
> Hi I did the 3 commands, and I still get the exact error.
>

Do you mean, "Site already exists"?

CJ

unread,
Aug 1, 2014, 1:30:51 AM8/1/14
to erpnext-dev...@googlegroups.com
Hi, no. I still get the exact same error message the stracetrace message.

Pratik Vyas

unread,
Aug 1, 2014, 2:12:23 AM8/1/14
to erpnext-dev...@googlegroups.com
On Fri, Aug 1, 2014 at 11:00 AM, CJ <joven...@gmail.com> wrote:
> Hi, no. I still get the exact same error message the stracetrace message.
>

There will be two traces, one would be called process error (below)
and the other one which we're interested in will be above.

The trace that you shared had "Site already exists" exception. Is that
what you got?

> On Friday, 1 August 2014 12:21:20 UTC+8, Pratik Vyas wrote:
>>
>> On Fri, Aug 1, 2014 at 7:18 AM, CJ <joven...@gmail.com> wrote:
>> > Hi I did the 3 commands, and I still get the exact error.
>> >
>>
>> Do you mean, "Site already exists"?
>
> --
> 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/0b50d7fb-a803-4c53-b384-03c5e553e874%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.


Thanks,
--
Pratik
erpnext

CJ

unread,
Aug 1, 2014, 2:37:31 AM8/1/14
to erpnext-dev...@googlegroups.com
Yes when I run bench migrate-3to4 /opt/erpnext, i have this:

I try to redo all the steps, now in sudo pip install -e bench-repo

I saw this:

------------------------------------------------------------
/usr/local/bin/pip run on Fri Aug  1 14:19:01 2014
bench-repomc should either by a path to a local project or a VCS url beginning with svn+, git+, hg+, or bzr+

Exception information:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/pip/basecommand.py", line 134, in main
    status = self.run(options, args)
  File "/usr/local/lib/python2.7/dist-packages/pip/commands/install.py", line 218, in run
    InstallRequirement.from_editable(name, default_vcs=options.default_vcs))
  File "/usr/local/lib/python2.7/dist-packages/pip/req.py", line 81, in from_editable
    name, url, extras_override = parse_editable(editable_req, default_vcs)
  File "/usr/local/lib/python2.7/dist-packages/pip/req.py", line 1516, in parse_editable
    '%s should either by a path to a local project or a VCS url beginning with svn+, git+, hg+, or bzr+' % editable_req)
InstallationError: bench-repomc should either by a path to a local project or a VCS url beginning with svn+, git+, hg+, or bzr+

Pratik Vyas

unread,
Aug 1, 2014, 2:43:21 AM8/1/14
to erpnext-dev...@googlegroups.com
> Exception: Site already exists

Can you confirm that sites/erpnext dir doesn't exist?


Also, no need to install bench-repo again as it's already installed.

Thanks,
--
Pratik
erpnext

Joven Chiew

unread,
Aug 1, 2014, 2:45:34 AM8/1/14
to erpnext-dev...@googlegroups.com
I saw sites/erpnext in ~/frappe-bench



Thanks,
--
Pratik
erpnext

--
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 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/obQa_4g1RY0/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/CAG8U0EksmxBt2jLLGFY7a9HmzLunCEpO201YdaiBO0hmWvLr6Q%40mail.gmail.com.

Pratik Vyas

unread,
Aug 1, 2014, 3:24:06 AM8/1/14
to erpnext-dev...@googlegroups.com
On Fri, Aug 1, 2014 at 12:15 PM, Joven Chiew <iamj...@gmail.com> wrote:
> I saw sites/erpnext in ~/frappe-bench
>

Can you move the sites/erpnext dir somewhere safe and try again. I
think the exception might have occoured somewhere else (say, in
patching).

The problem is that if you the command again, then the dir would exist
and will show a "site already exists exception"

Thanks,
--
Pratik
erpnext

CJ

unread,
Aug 1, 2014, 4:05:31 AM8/1/14
to erpnext-dev...@googlegroups.com
Hi, This is what I get after I mv the sites/erpnext:
Traceback (most recent call last):
  File "/tmp/bench-repo/bench/migrate3to4.py", line 98, in <module>
    main(args.site)
  File "/tmp/bench-repo/bench/migrate3to4.py", line 37, in main
    site = copy_site(path)
  File "/tmp/bench-repo/bench/migrate3to4.py", line 49, in copy_site
    os.mkdir(site_path)
OSError: [Errno 2] No such file or directory: 'sites/erpnext'
Error: None
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 9, in <module>
    load_entry_point('bench==0.1', 'console_scripts', 'bench')()
  File "/tmp/bench-repo/bench/cli.py", line 26, in cli
    return bench()
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 488, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 474, in main
    self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 758, in invoke
    return self.invoke_subcommand(ctx, cmd, cmd_name, ctx.args[1:])
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 767, in invoke_subcommand
    return cmd.invoke(cmd_ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 659, in invoke
    ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 325, in invoke
    return callback(*args, **kwargs)
  File "/tmp/bench-repo/bench/cli.py", line 117, in migrate_3to4
    site=path))
  File "/tmp/bench-repo/bench/utils.py", line 50, in exec_cmd
    subprocess.check_call(cmd, cwd=cwd, shell=True)
  File "/usr/lib/python2.7/subprocess.py", line 511, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'env/bin/python /tmp/bench-repo/bench/migrate3to4.py /opt/erpnext' returned non-zero exit status 1

Pratik Vyas

unread,
Aug 1, 2014, 4:42:45 AM8/1/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/56f6bb84-e03d-4826-917b-18c8d7634d01%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.

I'll be migrating a site to version 4 today. Let me see if anything is
wrong with the script.

--
Pratik
erpnext

CJ

unread,
Aug 3, 2014, 10:42:17 AM8/3/14
to erpnext-dev...@googlegroups.com
Hi, any finding? Is the script successful over your side?

Pratik Vyas

unread,
Aug 3, 2014, 2:51:48 PM8/3/14
to erpnext-dev...@googlegroups.com
On Sun, Aug 3, 2014 at 8:12 PM, CJ <joven...@gmail.com> wrote:
> Hi, any finding? Is the script successful over your side?

Hey,
Sorry for the late reply. It did work well for me the other day.
So, it atleast confirms that doesn't always complain about "Site
already exists".


> Command 'env/bin/python /tmp/bench-repo/bench/
migrate3to4.py /opt/erpnext' returned non-zero exit status 1

Also, this command is weird. Why is your bench repo in tmp?
and bench dir in /tmp/bench-repo/bench?

For a fresh start please do the following

```
cd /opt
bench init frappe-bench
cd frappe-bench
bench migrate-3to4 /opt/erpnext
```
>> > email to erpnext-developer...@googlegroups.com.
>> > To view this discussion on the web visit
>> >
>> > https://groups.google.com/d/msgid/erpnext-developer-forum/56f6bb84-e03d-4826-917b-18c8d7634d01%40googlegroups.com.
>> >
>> > For more options, visit https://groups.google.com/d/optout.
>>
>> I'll be migrating a site to version 4 today. Let me see if anything is
>> wrong with the script.
>>
>> --
>> Pratik
>> erpnext
>
> --
> 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/a57c08df-72ab-4ac0-a413-055bd2953d76%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.


Thanks,
--
Pratik
erpnext
Reply all
Reply to author
Forward
0 new messages