Update issue (cgi)

Thanks for the tip. I am trying to follow this document to upgrade an existing ERPNext installation: https://github.com/webnotes/erpnext/wiki/WSGI-Production-Deployment. . Is there any other import step missing?  



Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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-forum+un...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.
Installing all the dependencies got me through the --pull. Now the crash is at lib/wnf.py -- latest

Specifically it says "Invalid default value for 'send_invoice_by_mail'" This variable is a checkbox, and the current default value is (the number) 1. I would swear at one point we had this same error, but at that time we had set the default value to 'yes'. Setting it to 1 got us through. What is the proper default value to set a checkbox to the checked state?

 
Thanks for the tip. I am trying to follow this document to upgrade an existing ERPNext installation: https://github.com/webnotes/erpnext/wiki/WSGI-Production-Deployment. . Is there any other import step missing?  



Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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-forum+un...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.
Checked values should be 0 or 1

On Friday, January 24, 2014 5:04:36 AM UTC+5:30, Jonathan wrote:
Installing all the dependencies got me through the --pull. Now the crash is at lib/wnf.py -- latest

Specifically it says "Invalid default value for 'send_invoice_by_mail'" This variable is a checkbox, and the current default value is (the number) 1. I would swear at one point we had this same error, but at that time we had set the default value to 'yes'. Setting it to 1 got us through. What is the proper default value to set a checkbox to the checked state?

 



Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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-forum+un...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.
So I don't understand why --latest is complaining, since the default we have set is 1. Could it be the field has the default value "1" rather than 1--that is, a string rather than a number?

 Here is the full stack trace, if that sheds any light:

  File "./lib/wnf.py", line 803, in <module>
    main()
  File "./lib/wnf.py", line 23, in main
    run(fn, parsed_args)
  File "./lib/wnf.py", line 43, in run
    out = globals().get(fn)(**args)
  File "./lib/wnf.py", line 34, in new_fn
    return fn(*args, **new_kwargs)
  File "./lib/wnf.py", line 297, in latest
    webnotes.model.sync.sync_all()
  File "lib/webnotes/model/sync.py", line 16, in sync_all
    sync_for("app", force)
  File "lib/webnotes/model/sync.py", line 20, in sync_for
    return walk_and_sync(get_path(folder), force, sync_everything, verbose=verbose)
  File "lib/webnotes/model/sync.py", line 45, in walk_and_sync
    if import_file(module_name, doctype, name, force=force) and verbose:
  File "lib/webnotes/modules/import_file.py", line 30, in import_file
    ret = import_file_by_path(path, force)
  File "lib/webnotes/modules/import_file.py", line 51, in import_file_by_path
    import_doclist(doclist)
  File "lib/webnotes/modules/import_file.py", line 101, in import_doclist
    new_bean.insert()
  File "lib/webnotes/model/bean.py", line 260, in insert
    return self.save()
  File "lib/webnotes/model/bean.py", line 304, in save
    self.run_method('on_update')
  File "lib/webnotes/model/bean.py", line 239, in run_method
    getattr(self.controller, method)(*args, **kwargs)
  File "lib/core/doctype/doctype/doctype.py", line 72, in on_update
    updatedb(self.doc.name)
  File "lib/webnotes/model/db_schema.py", line 402, in updatedb
    tab.sync()
  File "lib/webnotes/model/db_schema.py", line 172, in sync
    self.alter()
  File "lib/webnotes/model/db_schema.py", line 197, in alter
    webnotes.conn.sql("alter table `%s` alter column `%s` set default %s" % (self.name, col.fieldname, '%s'), (col.default,))
  File "lib/webnotes/db.py", line 102, in sql
    self._cursor.execute(query, values)
  File "/usr/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 174, in execute
    self.errorhandler(self, exc, value)
  File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
_mysql_exceptions.OperationalError: (1067, "Invalid default value for 'send_invoice_by_mail'")



Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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-forum+un...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.
this seems like a custom field issue can you just print the query generated at:

  File "lib/webnotes/model/db_schema.py", line 197, in alter

also can you start a new thread for this?



On Friday, January 24, 2014 11:52:39 AM UTC+5:30, Jonathan wrote:
So I don't understand why --latest is complaining, since the default we have set is 1. Could it be the field has the default value "1" rather than 1--that is, a string rather than a number?

 Here is the full stack trace, if that sheds any light:

  File "./lib/wnf.py", line 803, in <module>
    main()
  File "./lib/wnf.py", line 23, in main
    run(fn, parsed_args)
  File "./lib/wnf.py", line 43, in run
    out = globals().get(fn)(**args)
  File "./lib/wnf.py", line 34, in new_fn
    return fn(*args, **new_kwargs)
  File "./lib/wnf.py", line 297, in latest
    webnotes.model.sync.sync_all()
  File "lib/webnotes/model/sync.py", line 16, in sync_all
    sync_for("app", force)
  File "lib/webnotes/model/sync.py", line 20, in sync_for
    return walk_and_sync(get_path(folder), force, sync_everything, verbose=verbose)
  File "lib/webnotes/model/sync.py", line 45, in walk_and_sync
    if import_file(module_name, doctype, name, force=force) and verbose:
  File "lib/webnotes/modules/import_file.py", line 30, in import_file
    ret = import_file_by_path(path, force)
  File "lib/webnotes/modules/import_file.py", line 51, in import_file_by_path
    import_doclist(doclist)
  File "lib/webnotes/modules/import_file.py", line 101, in import_doclist
    new_bean.insert()
  File "lib/webnotes/model/bean.py", line 260, in insert
    return self.save()
  File "lib/webnotes/model/bean.py", line 304, in save
    self.run_method('on_update')
  File "lib/webnotes/model/bean.py", line 239, in run_method
    getattr(self.controller, method)(*args, **kwargs)
  File "lib/core/doctype/doctype/doctype.py", line 72, in on_update
    updatedb(self.doc.name)
  File "lib/webnotes/model/db_schema.py", line 402, in updatedb
    tab.sync()
  File "lib/webnotes/model/db_schema.py", line 172, in sync
    self.alter()
  File "lib/webnotes/model/db_schema.py", line 197, in alter
    webnotes.conn.sql("alter table `%s` alter column `%s` set default %s" % (self.name, col.fieldname, '%s'), (col.default,))
  File "lib/webnotes/db.py", line 102, in sql
    self._cursor.execute(query, values)
  File "/usr/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 174, in execute
    self.errorhandler(self, exc, value)
  File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
_mysql_exceptions.OperationalError: (1067, "Invalid default value for 'send_invoice_by_mail'")



Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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-forum+un...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.
Sorry, I already cleared the machine to start the upgrade over.  Next problem: when I try 

pip install -r lib/requirements.txt 

or when i try

pip install mysql-python==1.2.4

I get the following stack trace.

Any suggestions?

---------------------------------------


Downloading/unpacking MySQL-python==1.2.4 (from -r lib/requirements.txt (line 3))
  Downloading MySQL-python-1.2.4.zip (113kB): 113kB downloaded
  Running setup.py egg_info for package MySQL-python
    Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz
    Extracting in /tmp/tmpcqdUKM
    Now working in /tmp/tmpcqdUKM/distribute-0.6.28
    Building a Distribute egg in /tmp/pip-build/MySQL-python
    /tmp/pip-build/MySQL-python/distribute-0.6.28-py2.7.egg
    sh: 1: mysql_config: not found
    Traceback (most recent call last):
      File "<string>", line 16, in <module>
      File "/tmp/pip-build/MySQL-python/setup.py", line 18, in <module>
        metadata, options = get_config()
      File "setup_posix.py", line 43, in get_config
        libs = mysql_config("libs_r")
      File "setup_posix.py", line 25, in mysql_config
        raise EnvironmentError("%s not found" % (mysql_config.path,))
    EnvironmentError: mysql_config not found
    Complete output from command python setup.py egg_info:
    Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz

Extracting in /tmp/tmpcqdUKM

Now working in /tmp/tmpcqdUKM/distribute-0.6.28

Building a Distribute egg in /tmp/pip-build/MySQL-python

/tmp/pip-build/MySQL-python/distribute-0.6.28-py2.7.egg

sh: 1: mysql_config: not found

Traceback (most recent call last):

  File "<string>", line 16, in <module>

  File "/tmp/pip-build/MySQL-python/setup.py", line 18, in <module>

    metadata, options = get_config()

  File "setup_posix.py", line 43, in get_config

    libs = mysql_config("libs_r")

  File "setup_posix.py", line 25, in mysql_config

    raise EnvironmentError("%s not found" % (mysql_config.path,))

EnvironmentError: mysql_config not found

----------------------------------------
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build/MySQL-python
Storing complete log in /root/.pip/pip.log



Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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-forum+un...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.
new thread please :(

On Friday, January 24, 2014 3:56:15 PM UTC+5:30, Jonathan wrote:
Sorry, I already cleared the machine to start the upgrade over.  Next problem: when I try 

pip install -r lib/requirements.txt 

or when i try

pip install mysql-python==1.2.4

I get the following stack trace.

Any suggestions?



Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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-forum+un...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.

Hi Jonathan,

The mess seems to be because there are two python2.7 instances!
which python2.7 points to the python in /usr/bin/python2.7

and
pip —version uses python from /usr/local/lib/python2.7!

Both of them are referring to different python site-packages and hence the whole problem.

I think you already had python 2.7 globally installed and then you installed python 2.7 using alt install.

Your best bet would be to remove the alt installed python2.7 from the /usr/local/lib/python2.7

Basically, pip —version should point to /usr/bin/python2.7

Best,
Anand Doshi.

On 23 January 2014 at 4:56:22 pm, Jonathan (ir...@gmail.com) wrote:

The pip install did a few things but was unable to upgrade mysql-python.
result of pip --version did not change.

root@:/var/www/erpnext# pip --version
pip 1.2.1 from /usr/local/lib/python2.7/dist-packages/pip-1.2.1-py2.7.egg
(python 2.7)

root@:/var/www/erpnext# python2.7 -c “import werkzeug”
Traceback (most recent call last):
File “”, line 1, in
ImportError: No module named werkzeug

root@:/var/www/erpnext# which python2.7
/usr/bin/python2.7


Note:

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com
    and send only the URL via email
  3. 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-forum+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Note:

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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-forum+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

1 Like