OpenAM: Installation fails with LDAPException

August 24, 2011 in Unix / Linux

When installing OpenAM (formerly OpenSSO) with the configuration store pointing to an OpenDJ (formerly OpenDS) LDAP server, our installation fails with a LDAPException as follows:

 
Configuring system.AMSetupServlet.processRequest: errorSMSException Exception Code:3
Message:The LDAP operation failed.
————————————————–
The lower level exception message
error result
The lower level exception:
com.sun.identity.shared.ldap.LDAPException: error result (65); Entry ou=services,ou=systems,dc=include,dc=io cannot not be modified because the resulting entry would have violated the server schema: Entry ou=services,ou=systems,dc=include,dc=io violates the Directory Server schema configuration because it includes multiple conflicting structural objectclasses organizationalUnit and sunservicecomponent. Only a single structural objectclass is allowed in an entry.

This problem occurs because the Sun Access Manager schema is not conforming to full LDAP standards that are enforced by OpenDJ installation.

To solve this problem, you need to edit the config/config.ldif file from your current OpenDJ configuration and set the ds-cfg-single-structural-objectclass-behavior to accept.

- ds-cfg-single-structural-objectclass-behavior: deny
+ ds-cfg-single-structural-objectclass-behavior: accept

Restart the OpenDJ external directory service after changing this parameter and you are ready to deploy OpenAM as expected!

There is an open bug report about this problem at: https://bugster.forgerock.org/jira/browse/OPENAM-312. Thanks Steve Ferris for the information! :)

Export user list in Ejabberd

May 13, 2011 in Unix / Linux

There are lots of ways to upgrade ejabberd service without downtime, but sometimes when managing a corporate instant messaging server we need to reformulate our entire messaging architecture in a new server and we can just export all users and passwords to a list and then import them to the new server using just the command line and mod_cltextra / mod_admin module.

There’s no automated way to export all users like Openfire does, but we can dump our entire database (considering that you are using the internal erlang mnesia database) to a text file and filter just the values we want (in this case, users and passwords) using the following steps:

Dump the database to a text file:

# ejabberd_ctl ejabberd@localhost dump /tmp/mnesia.dump

Filter the dump to get only registered users

# cat /tmp/mnesia.dump | grep ‘{passwd,{‘ > /tmp/tmplist.txt

Convert your temporary generated file to the format you prefer, in this case getting a list (username, hostname, password):

# sed -e ‘s/{passwd,{“//g;s/”,”/ /g;s/”},”/ /g;s/”}.//g’ /tmp/tmplist.txt > /tmp/userlist.txt

Obs. The database registers that store user information in the dump have the following format:
{passwd,{“USER”,”VIRTUAL-HOST”},”PASSWORD”}.

Erlang Mnesia Overload Events

May 10, 2011 in Development

Normally when running a high concurrency Erlang application (like Ejabberd XMPP server) that uses Erlang’s mnesia internal database as the application’s database back end in a heavy traffic environment you run into the following error message:

=ERROR REPORT==== 23-Jun-2010::00:59:19 ===
Mnesia(node@server): ** WARNING ** Mnesia is overloaded: {dump_log, write_threshold}

This warning event is usually shown when using mnesia disc_copies tables and doing a lot of writes to disk all at once (considering you are using asynchronous writes), and of course it can get really annoying when they start happening every second. We can drastically reduce the occurrence of this error changing 2 configuration parameters, the dc_dump_limit and dump_log_write_threshold.

dc_dump_limit
This parameter controls how often disc_copies tables are dumped from memory, the default value is 4 that means if the log size is greater than the table size divided per 4 (table size / 4) it starts the dump. You can make dumps happen more often increasing this value.

dump_log_write_threshold
This parameter defines the maximum number of writes to the transaction log before a new dump is performed, using the default value 100 a new transaction log dump is performed after every 100 writes. You can increase this value giving more time to the write process to finish, but be sure that you have enough RAM on your server to maintain the transactions running.

And now, what does it mean?

Mnesia activity is recorded in transaction logs, that gets dumped to table logs, which in turn are dumped to table files on disk. By increasing the dump_log_write_threshold, transaction logs are dumped much less often, giving more time to the last dump be completed before the next dump is triggered. By the way, increasing the dc_dump_limit helps ensure that the disk table is dumped from the logs more often.

You can configure the parameters using the following syntax inside erlang shell:

{mnesia, [{dc_dump_limit, 40}, {dump_log_write_threshold, 50000}]}

Remember to change the values according to your needs!

Métodos de inicialização do Nokia N85 / N95

April 30, 2011 in Mobile

Existem 3 métodos para a reinicialização de celulares Nokia NSeries que utilizam plataforma Symbian S60 (N85, N95, etc…), cada um com suas características próprias. Segue um breve descritivo de cada uma delas:

Restaurar configurações de fábrica (desta forma não há perda de dados)
Para realizar este procedimento certifique-se de ter um backup recente de seu aparelho e digite a sequência *#7780#, lembre-se que será solicitado seu código de segurança para completar o processo.

Reformatação do dispositivo
Para realizar a reformatação do dispositivo, primeiramente certifique-se de ter um backup recente realizado, e então entre com a sequência *#7370#. Assim como na restauração de configurações de fábrica, será solicitado o código de segurança para completar a operação. Lembre se que inclusive os dados presentes no memory card serão perdidos quando este método é utilizado.

Restauração e formatação completa do dispositivo
Este tipo de procedimento é utilizado quando precisamos limpar completamente nosso dispositivo, incluindo configurações, softwares, arquivos pessoais e arquivos de sistema causando perda total de dados. Para realizar este procedimento, primeiramente desligue seu aparelho e pressione as seguintes teclas juntamente com a tecla liga/desliga: *, 3 e Talk/tecla verde. Mantenha as teclas pressionadas até a inicialização completa do aparelho e ele estará completamente limpo somente com o sistema base.

Obs. Caso você tenha licensas para execução de filmes ou aplicações e utilize o terceiro método de reset elas serão invalidadas e perdidas, portanto utilize a 3ª opção somente em casos de extrema emergência onde os 2 primeiros métodos não forem suficientes.

Problema com gravacao de vídeo no Nokia N85

April 26, 2011 in Mobile

Realmente os celulares Nokia NSeries fazem filmes e fotos com altíssima qualidade, porém o N85 normalmente apresenta problemas na gravação de vídeos durante as primeiras utilizações deixando várias pausas no meio do vídeo durante sua exibição, a princípio pensei ser um problema com a execução do vídeo diretamente no celular porém ao copiar o vídeo e executar ele no laptop as pausas continuavam sem parar.

Dando uma pesquisada mais a fundo encontrei mais pessoas que tinham o mesmo problema, e também encontrei uma solução muito simples que funcionou em praticamente 100% dos casos. Simplesmente faça um backup completo do memory card e realize a formatação dele diretamente pelo celular para refazer a tabela de alocação de arquivos.

Esse problema acontece devido a formatação inicial presente no memory card que interrompe a gravação contínua do fluxo de dados enquanto os blocos são realocados.

Após a formatação do memory card simplesmente restaure seus arquivos e começe a gravar os vídeos normalmente, todos eles serão gravados e executados sem as terríveis pausas!

Obs. Após o restore dos arquivos é interessante desligar e ligar o aparelho para que todas as aplicações sejam carregadas novamente.

Debian xen guest apt-key problem

March 30, 2011 in Unix / Linux

When installing a Debian Lenny guest system on a Citrix Xen Server host, we get a common problem with the citrix xen repository signature verification due to the missing public key on your system, normally showing the following error:

Reading package lists… Done
W: GPG error: http://updates.xensource.com etch Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 841D6D8DFE3F8BB2
W: You may want to run apt-get update to correct these problems

To solve this problem and get rid of the warning, just add the following key to your system:

# wget -q http://updates.vmd.citrix.com/XenServer/5.5.0/GPG-KEY -O- | apt-key add -
# apt-get update