Pular navegação

Category Archives: throubleshooting

Se você está tendo este problema irritante, e não consegue resolver experimente fazer o seguinte: Instale o programa “Go SMS Pro” (ele é gratuíto) e dê uma olhada nas suas mensagens. Apague as mensagens que estiverem com um ícone de aviso (uma exclamação dentro de um triângulo) e depois tente abrir novamente o programa de mensagens original. Essa solução resolveu meu problema em um Galaxy Gran DUOS.

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!

Download psycopg2 at http://initd.org/pub/software/psycopg/

To install  (I’m using the version 2.0.10) you need to run two commands:

# python setup.py build

and after the build is complete:

# python setup.py install

Well, but it’s not so easy if you do not have the dependencies already installed.In my case I got errors like:

NameError: global name ‘w’ is not defined psycopg2

or

error: Setup script exited with error: command ‘gcc’ failed with exit status 1

To solve this I have to install the libpq-dev library and the python development package:

# apt-get install libpq-dev

# apt-get install python2.5-dev

After that I just run the usual python setup.py install and all done.

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

Problema: Ao acessar uma página com código do Google Maps o Internet Explorer 7 não abre a página e mostra a mensagem “Internet Explorer cannot open the Internet Site Operation aborted

Solução: Colocar todo o código JavaScript que carrega e manipula o GoogleMaps no fim do documento.

Nota: Fucking Internet Explorer!

Esse problema na realidade não é do Django, e sim do módulo psycopg2 que faz acesso ao PostgreSQL (No meu caso eu estava utilizando a versão 2.0.6 deste módulo). Para resolver este problema é preciso atualizá-lo para o 2.0.7.

Read More »

Ao tentar empacotar um projeto com o Maven o danado sempre dava erro dizendo que não conseguia baixar as dependências do meu projeto.

Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.2/maven-resources-plugin-2.2.pom
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

GroupId: org.apache.maven.plugins
ArtifactId: maven-resources-plugin
Version: 2.2

Reason: Unable to download the artifact from any repository

org.apache.maven.plugins:maven-resources-plugin:pom:2.2

from the specified remote repositories:
central (http://repo1.maven.org/maven2)

O arquivo existia no repositório e eu já estava ficando louco achando que era algum problema com proxy ou coisa do gênero. Foi quando eu resolvi verificar com mais cuidado o arquivo settings.xml que eu havia acabado de copiar.

Resultado: O problema é que meu “localRepository” estava apontando para um local em que meu usuário não tinha permissão de escrita. E se eu dependesse das mensagens do Maven para descobrir isso…