16. July 2017

Android Studio: Failure INSTALL_FAILED_TEST_ONLY

Starting application from Android Studio may fail with the mysterious message: Installation failed with message INSTALL_FAILED_TEST_ONLY.

The IDE will prompt you whether you want to uninstall the existing application.

Even this uninstallation may fail. When you open Run console, you can see something like this:

$ adb shell pm uninstall rocks.georgik.sdlapp
$ adb shell pm install -r "/data/local/tmp/rocks.georgik.sdlapp"
	pkg: /data/local/tmp/rocks.georgik.sdlapp
Failure [INSTALL_FAILED_TEST_ONLY]

$ adb shell pm uninstall rocks.georgik.sdlapp
DELETE_FAILED_INTERNAL_ERROR
Error while Installing APK

There is a relatively simple fix to this issue. Click drop-down menu with your configuration and choose Edit Configurations…

Select tab General and add -t to Install Flags field. Click Ok.

Now start the application again and it should work.

9. December 2015

Thunderbird and Outlook solution of problem with Courier IMAP sslv3 alert illegal parameter

E-mail clients like Thunderbird or Outlook stopped to communicate with Courier IMAP/SMTP/POP TLS after some upgrade.

The only clue in log file was this error message:

courier couriertls: accept: error:14094417:SSL routines:ssl3_read_bytes:sslv3 alert illegal parameter

The problem was that certificate for IMAP (/etc/courier/imapd.pem) and /etc/courier/dhparam.pem were containing too short key. The short key was sufficient in past for encrypted communication. Unfortunately maintainers of Debian package forgot to add fix for upgrade.

It is very simple to fix the issue. Just generate DH with sufficient length.

DH_BITS=2048 mkdhparams

This command will update /etc/courier/dhparm.pem.

Make sure to update all pem files in case that they contain DH record.

Restart services and clients should be able to reconnect without problem.

If you still experience some issues with PEM files check out article PEM routines:PEM_read_bio:no start line.

31. December 2012

KVM error: internal error no HVM domain loader – solution

It’s very pleasant situation when you reboot Linux server and it starts.

It’s very unpleasant situation when this server contains many KVM virtual servers and none of them start. 🙁

virsh list displays just this:

Id Name State
----------------------------------
 0 Domain-0 running

That’s nonsense. There was no such virtual with name Domain-0.

When you try to create domain you can see this fancy error message:

[root@server qemu]# virsh create ./virtual-01.xml
error: Failed to create domain from ./virtual-01.xml
error: internal error no HVM domain loader

What went wrong? How to fix it?

I spare you long story with server diagnostic.

The problem was that server started different kernel after reboot. In this case it was different kernel with Xen support. Centos kernel with Xen support does not have KVM support. That’s quite logical. It was sufficient to change default kernel in grub.conf to non-Xen version, restart machine and everything was working like a charm.

1. December 2012

Common mistake when creating new git repo. Error: src refspec master does not match any.

Creating new git repo and pushing it to remote server is fairly easy.

mkdir my-project
cd my-project
git init

You can work with project localy. When you want to push it to remote server, then it is necessary to add remote repo url.

git remote add origin <MY-URL>

Now you can push it:

git push -u origin master

When it works. Hooray. Sometimes you may find following error:

error: src refspec master does not match any.
error: failed to push some refs to '<MY-URL>'

The reason why this happens is not that obvious. 🙂

Git creates master branch only after commit to your local repo. If you just initialize repo then there is no master. How to fix it?

Just add and commit at least one change to your repo and re-run push command. You can add e.g. .gitignore.

You can find more info at StackOverflow.

17. June 2012

How to solve some problems with Drupal after upgrade to PHP 5.4

I’ve found several interesting issue after upgrading PHP 5.3 to PHP 5.4 on Drupal 6 and Drupal 7 sites.

The first biggest problem was that Drupal was displaying Access denied message on all web pages. It was not possible to login to system. Even http://localhost/?q=admin didn’t work.

I had to create temporary session. It is quite easy when using Drush:

drush user-login

Drush displayed one time session for admin. This solved the problem with admin login.

The other issue was that there was Access denied message on every page. There were also other very useful messages flooding each page:

Notice: Undefined index: access in function _menu_link_translate() …

I spent some time searching for any hint how to resolve this weird behavior. It was necessary to delete all Drupal’s caches.

Configuration -> Development -> Performance -> Delete cache

After this clean up Drupal was working correctly.

Then I checked one older Drupal 6 site and there was nice big red warning:

Warning: strtotime() [function.strtotime]: It is not safe to rely on the system’s timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier.

The problem was that there was no default timezone in php.ini. It was sufficient to add timezone to /etc/php5/apache2/php.ini to section

[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = "Europe/Prague"

You can find more info about timezones at php.net/date.timezone.

After reloading Apache configuration everything was ok.

  • Where is the fish?

  • Further info

  • Twitter

    Follow @jurajmichalek on twitter.

  • Comments

  • Tags

  • Topics