Arquivo de Tags: troubleshooting

Problem:  When uploading images to Satchmo I got this error message: "Upload a valid image. The file you uploaded was either not an image or a corrupted image." even with valid JPEG files.

To test the Python Image Library (PIL) I’d  executed this code on python console:

from PIL import Image
file = open("/tmp/logo.jpg")
image_test = Image.open(file)
image_test.load()

what output:

<PixelAccess object at 0x37dce100>

This is ok, but when I’d run the same code inside a Django view I got the error "decoding error when reading image file".

I checked the Python Path and it was the same for both console and Django Application.

After looking on google I discover a post from Peter Schoenster on “Django-Photologue“  wiki page saying he had the same problem and discovered that python shell was using one version of libjpeg and Apache was using other. (He, as me had two version of this library on the system). He discovered it using the command

# lsof | grep libjpeg

I just remove the old libjpe62 from my system using:

# apt-get remove libjpeg62

And everything works !

Problem: Error on Uploading a image file to Satchmo. Message: "Upload a valid image. The file you uploaded was either not an image or a corrupted image."

To test the Python Image Library (PIL) I run this code on python console:

from PIL import Image
file = open("/tmp/logo.jpg")
image_test = Image.open(file)
image_test.load()

what output:

<PixelAccess object at 0x37dce100>

This is ok, but when I run the same code inside a Django view I got the error "decoding error when reading image file".

I checked the Python Path and it was the same for both console and Django Application.

After looking on google I discover a post from Peter Schoenster on “Django-Photologue”  home page saying he had the same problem and discovered that python shell was using one version of libjpeg and Apache was using other. (He, as me had two version of this library on the system). He discovered it using the command

# lsof | grep libjpeg

I just remove the old libjpe62 from my system using:

# apt-get remove libjpeg62

And everything works !

When I tried to install the Library PIL on a Ubuntu 8.04 where I had installed  Python 2.6 I got:

.
.
.
running build_ext
building ‘_imagingtk’ extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/freetype2 -IlibImaging -I/opt/python.org/python/python-2.6/include -I/usr/local/include -I/usr/include -I/opt/python.org/python/python-2.6/include/python2.6 -c _imagingtk.c -o build/temp.linux-i686-2.6/_imagingtk.o
_imagingtk.c:20:16: error: tk.h: No such file or directory
_imagingtk.c:23: error: expected ‘)’ before ‘*’ token
_imagingtk.c:31: error: expected specifier-qualifier-list before ‘Tcl_Interp’
_imagingtk.c: In function ‘_tkinit’:
_imagingtk.c:37: error: ‘Tcl_Interp’ undeclared (first use in this function)
_imagingtk.c:37: error: (Each undeclared identifier is reported only once
_imagingtk.c:37: error: for each function it appears in.)
_imagingtk.c:37: error: ‘interp’ undeclared (first use in this function)
_imagingtk.c:45: error: expected expression before ‘)’ token
_imagingtk.c:51: error: ‘TkappObject’ has no member named ‘interp’
_imagingtk.c:55: warning: implicit declaration of function ‘TkImaging_Init’
error: command ‘gcc’ failed with exit status 1

I’d founded the file ‘tk.h‘ on ‘/usr/include/tcl8.4‘ and after a look at the setup.py file I changed the line number 41 from:

TCL_ROOT = None

to

TCL_ROOT = “/usr/include/tcl8.4″

Now you can run your ‘python setup.py install’ again and get PIL working!

Note: You may perhaps have to install the tk-dev and tcl-dev packages before running the setup.py. I’d already had these packages, so I’m not sure about it.

On Ubuntu run:

apt-get install tk-dev tcl-dev

Satchmo is a great shopping cart application that uses Python and Django. If you are looking for this kind of application it worth a look.

One of the best point of Satchmo is how easy and beautiful is to customize your application. You can create customized product model without touch the base Satchmo models. It’s a great feature, that make easy to apply future Satchmo updates.

You can learn how to create a custom product in JuanjoAlvarez Blog.

I followed the instructions but get the error:

Wed, 12 Aug 2009 11:57:17 configuration DEBUG SettingNotSet: PRODUCT.PRODUCT_TYPES
Traceback (most recent call last):
File "./manage.py", line 27, in
execute_manager(settings)
.
.
.
.
raise SettingNotSet('%s config group does not exist' % group)
livesettings.models.SettingNotSet

SOLUTION: After apply a grep in the Satchmo code for “PRODUCT_TYPES” I figured out my mistake: My package was named product: the same name of the Satchmo product application. So it was overriding the framework application.

Thank god Satchmo is a Open Source project!

Problem: If we change the default SSH port Zimbra features like Mail Queues stop working.

Workaround:

$ su - zimbra

$ zmprov mcf zimbraRemoteManagementPort <new port number>

Para resolver o problema com as setas do teclado no console de uma máquina virtual no VMware Server 2.0 basta editar o arquivo ~/.vmware/config e inserir as seguintes linhas:

xkeymap.keycode.108 = 0x138 # Alt_R
xkeymap.keycode.106 = 0x135 # KP_Divide
xkeymap.keycode.104 = 0x11c # KP_Enter
xkeymap.keycode.111 = 0x148 # Up
xkeymap.keycode.116 = 0x150 # Down
xkeymap.keycode.113 = 0x14b # Left
xkeymap.keycode.114 = 0x14d # Right
xkeymap.keycode.105 = 0x11d # Control_R
xkeymap.keycode.118 = 0x152 # Insert
xkeymap.keycode.119 = 0x153 # Delete
xkeymap.keycode.110 = 0x147 # Home
xkeymap.keycode.115 = 0x14f # End
xkeymap.keycode.112 = 0x149 # Prior
xkeymap.keycode.117 = 0x151 # Next
xkeymap.keycode.78 = 0x46 # Scroll_Lock
xkeymap.keycode.127 = 0x100 # Pause
xkeymap.keycode.133 = 0x15b # Meta_L
xkeymap.keycode.134 = 0x15c # Meta_R
xkeymap.keycode.135 = 0x15d # Menu

Observação: O WordPress troca as letras x dos códigos hexadecimais por um carácter estranho. Verifique isso antes de colar no arquivo.

fonte: http://communities.vmware.com/message/508070