Showing posts with label troubleshooting. Show all posts
Showing posts with label troubleshooting. Show all posts

Monday, November 28, 2011

ruby-debug on 1.9.3 (Windows)

Couldn't get the gems installed yet:

>gem install ruby-debug-base19 --version=0.11.26 -- --configure-options --with-ruby-include="C:\PROGRA~2\Ruby\1.9.3-p0\include\ruby-1.9.1\ruby-1.9.3-p0"
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing ruby-debug-base19:
        ERROR: Failed to build gem native extension.

        C:/PROGRA~2/Ruby/1.9.3-p0/bin/ruby.exe extconf.rb --configure-options --with-ruby-include=C:\PROGRA~2\Ruby\1.9.3-p0\include\ruby-1.9.1\ruby-1.9.3-p0
checking for rb_method_entry_t.called_id in method.h... yes
checking for vm_core.h... yes
checking for iseq.h... yes
checking for insns.inc... yes
checking for insns_info.inc... yes
checking for eval_intern.h... yes
checking for struct iseq_line_info_entry in vm_core.h,iseq.h... no
checking for struct iseq_insn_info_entry in vm_core.h,iseq.h... yes
checking for if rb_iseq_compile_with_option was added an argument filepath... yes
creating Makefile

make
generating ruby_debug-i386-mingw32.def
compiling breakpoint.c
breakpoint.c:3:21: fatal error: vm_core.h: No such file or directory
compilation terminated.
make: *** [breakpoint.o] Error 1


Gem files will remain installed in C:/PROGRA~2/Ruby/1.9.3-p0/lib/ruby/gems/1.9.1/gems/ruby-debug-base19-0.11.26 for inspection.
Results logged to C:/PROGRA~2/Ruby/1.9.3-p0/lib/ruby/gems/1.9.1/gems/ruby-debug-base19-0.11.26/ext/ruby_debug/gem_make.out

Luis Lavena lent me a hand on this, but that couldn't solve the problem.

Update: Moving your Ruby installation to a path without spaces fixes the problem. I thought PROGRA~2 could work just find. Thanks Luis once again.

Thursday, October 7, 2010

Zend Debugger > XDebug makes PDT > Netbeans

Displaying variable values - including breakdown values of their attributes - of current scope has been the most important thing to my debugging practice.

AFAIK, Netbeans PHP IDE only supports XDebug. XDebug is known to be unstable with watches and balloons (and I have had too many crashes experience) and having this defect yields Netbeans useless IMO.

I use PDT together with XDebug over the past 3 years of active PHP development and for the past few days (finally) I started using Zend Debugger. Then I realized that it has the "problem" of only displaying variables in scope (e.g. function scope), meaning, global variables and $this will not be shown, due to usability and performance concern.

The fix is pretty simple (after reading this forum response), just place watches if you want to monitor out-of-scope variables.

Monday, February 22, 2010

Some Groovy Class-Loading Notes

Was trying to load a resource (*.properties) from the class-path and as you know, class loading can be a PITA at different enviroments (IDEs, build tools, tests, containers).

Here's the snippet I used, ran with Maven and Eclipse IDE, target/test-classes is in the class-path.
String name = "aflexi.itest.properties"

// System CL
println ClassLoader.getSystemClassLoader()
// Uses system or bootstrap CL
println ClassLoader.getSystemResource(name)

// Caller CL
println ClassLoader.getCallerClassLoader()
println ClassLoader.getCallerClassLoader().getResource(name)

// Class's class loader. Perfectly fine in both places
println getClass().getClassLoader()
println getClass().getClassLoader().getResource("aflexi.itest.properties")

// Doesn't work anywhere, the CL is the one of previous, but the name will be resolved as "net/aflexi/cdn/test/itest/aflexi.itest.properties"
println getClass().getClassLoader0()
println getClass().getResource("aflexi.itest.properties")

// Doesn't work either. Using Groovy's calling class.
println ReflectionUtils.getCallingClass()
println ReflectionUtils.getCallingClass().getResource("aflexi.itest.properties")

And here's the result:

Expression / Class LoaderTest 1: InstanceTest 2: InstanceTest 1: Found Resource?Test 2: Found Resource?
ClassLoader.getSystemClassLoader().getResource()sun.misc.Launcher$AppClassLoader@19134f4sun.misc.Launcher$AppClassLoader@19134f410
ClassLoader.getCallerClassLoader().getResource()sun.misc.Launcher$AppClassLoader@19134f4org.codehaus.groovy.tools.RootLoader@8965fb11
getClass().getClassLoader().getResource()groovy.lang.GroovyClassLoader$InnerLoader@14177f3groovy.lang.GroovyClassLoader$InnerLoader@dc043511
getClass().getResource()groovy.lang.GroovyClassLoader$InnerLoader@14177f3groovy.lang.GroovyClassLoader$InnerLoader@dc043500
ReflectionUtils.getCallingClass().getResource()class cuke4duke.internal.groovy.GroovyLanguageclass groovy.ui.GroovyMain00

Take note that, getClass().getResource() uses the same CL instance (otherwise system CL) with getClass().getClassLoader().getResource(). The reason why it failed is that, it resolves the name of the properties file with package name, i.e. aflexi.itest.properties to net/aflexi/cdn/test/itest/aflexi.itest.properties.

Saturday, November 7, 2009

Wireless Network disappeared after Ubuntu 9.10 (Karmic) upgrade

Upgraded to 9.10 this morning but funny thing was - wireless networking wasn't working anymore - ath_pci module is gone from the release.

Fixed by loading the ath5k module, as suggested by the ThinkPad wiki. You can append it to /etc/modules for it to be automatically loaded.

Friday, July 10, 2009

Hibernate session issue during Spring tests

I reckon this is something good to share as it took me a few hours to get the problem resolved.

We are using SpringJUnit4ClassRunner for our DAO tests, the tests passed when they were run in Eclipse, but not in Maven. One of the test classes failed with HibernateSystemException:

org.springframework.orm.hibernate3.HibernateSystemException: Illegal attempt to associate a collection with two open sessions; nested exception is org.hibernate.HibernateException: Illegal attempt to associate a collection with two open sessions

Google search gave me some clue about the problem had something to do with cascading style, transaction, and duplication but they didn't lead me anywhere. I broke at AbstractPersistentCollection.setCurrentSession to find out that the session/session factory (DAOs are instances of HibernateDaoSupport) assigned to one of the DAOs was different.

A second look at the test class which had:
@Autowired
BillingInvoiceDao $;
BillingOrderDao orderDao;
BillingItemDao itemDao;
MembershipDao membershipDao;

@Override
protected void setUpDataAccessObjects() {
membershipDao = DataAccessObjectHelper.getDataAccessObject(MembershipDao.class);
itemDao = DataAccessObjectHelper.getDataAccessObject(BillingItemDao.class);
orderDao = DataAccessObjectHelper.getDataAccessObject(BillingOrderDao.class);
}

I found out that BillingInvoiceDao was not a proxy instance but the other DAOs are. The log may explain something:
[07-11 09:19:30] DEBUG AutowiredAnnotationBeanPostProcessor [main]: Autowiring by type from bean name 'itest.net.aflexi.cdn.billing.HibernateBillingInvoiceDaoTest' to bean named 'billingInvoiceDao'
[07-11 09:19:30] DEBUG DefaultListableBeanFactory [main]: Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'
[07-11 09:19:30] DEBUG DefaultListableBeanFactory [main]: Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'
[07-11 09:19:30] DEBUG AnnotationTransactionAttributeSource [main]: Adding transactional method [testCrud] with attribute [PROPAGATION_REQUIRED,ISOLATION_DEFAULT]
[07-11 09:19:30] DEBUG AnnotationAwareAspectJAutoProxyCreator [main]: Creating implicit proxy for bean 'itest.net.aflexi.cdn.billing.HibernateBillingInvoiceDaoTest' with 0 common interceptors and 1 specific interceptors
[07-11 09:19:30] DEBUG JdkDynamicAopProxy [main]: Creating JDK dynamic proxy: target source is SingletonTargetSource for target object [itest.net.aflexi.cdn.billing.HibernateBillingInvoiceDaoTest@17afcff]
[07-11 09:19:30] DEBUG AnnotationTransactionAttributeSource [main]: Adding transactional method [testCrud] with attribute [PROPAGATION_REQUIRED,ISOLATION_DEFAULT]
[07-11 09:19:30] DEBUG TransactionalTestExecutionListener [main]: Explicit transaction definition [PROPAGATION_REQUIRED,ISOLATION_DEFAULT] found for test context [[TestContext@134b58c testClass = HibernateBillingInvoiceDaoTest, locations = array['classpath:spring/dataAccessTestContext.xml', 'classpath:spring/dataAccessTestContext.billing.xml'], testInstance = itest.net.aflexi.cdn.billing.HibernateBillingInvoiceDaoTest@17afcff, testMethod = testCrud@HibernateBillingInvoiceDaoTest, testException = [null]]]
[07-11 09:19:30] DEBUG TransactionalTestExecutionListener [main]: Retrieved @TransactionConfiguration [@org.springframework.test.context.transaction.TransactionConfiguration(defaultRollback=true, transactionManager=mainTxManager)] for test class [class itest.net.aflexi.cdn.billing.HibernateBillingInvoiceDaoTest]
[07-11 09:19:30] DEBUG TransactionalTestExecutionListener [main]: Retrieved TransactionConfigurationAttributes [[TransactionConfigurationAttributes@ddc524 transactionManagerName = 'mainTxManager', defaultRollback = true]] for class [class itest.net.aflexi.cdn.billing.HibernateBillingInvoiceDaoTest]
[07-11 09:19:30] DEBUG DefaultListableBeanFactory [main]: Returning cached instance of singleton bean 'mainTxManager'
[07-11 09:19:30] DEBUG TransactionalTestExecutionListener [main]: Executing @BeforeTransaction method [public void net.aflexi.cdn.core.test.AbstractDaoTest.setUpBeforeTransaction() throws java.lang.Exception] for test context [[TestContext@134b58c testClass = HibernateBillingInvoiceDaoTest, locations = array['classpath:spring/dataAccessTestContext.xml', 'classpath:spring/dataAccessTestContext.billing.xml'], testInstance = itest.net.aflexi.cdn.billing.HibernateBillingInvoiceDaoTest@17afcff, testMethod = testCrud@HibernateBillingInvoiceDaoTest, testException = [null]]]
[07-11 09:19:30] DEBUG DefaultListableBeanFactory [main]: Returning cached instance of singleton bean 'membershipDao'

That transaction propagation happened after autowiring of beans. The fix of my problem is to @Autowired all DAOs (so that they are consistent) or assign them via the DataAccessObjectHelper as shown in the snippet.

Hope this helps.

Friday, April 10, 2009

Strange Maven Plugin Metadata Problem

Not too sure when, my Maven Eclipse plugin has been upgraded to 2.6 and probably due to some metadata "corruption", its dependencies were not downloaded, running it caused ClassNotFoundException:

[INFO] ------------------------------------------------------------------------
[INFO] Building Whatever
[INFO] task-segment: [eclipse:eclipse]
[INFO] ------------------------------------------------------------------------
[INFO] Preparing eclipse:eclipse
...
-----------------------------------------------------
this realm = app0.child-container[org.apache.maven.plugins:maven-eclipse-plugin:2.6]
urls[0] = file:/home/yclian/.m2/repository/org/apache/maven/plugins/maven-eclipse-plugin/2.6/maven-eclipse-plugin-2.6.jar
urls[1] = file:/home/yclian/.m2/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
Number of imports: 10
import: org.codehaus.classworlds.Entry@a6c57a42
import: org.codehaus.classworlds.Entry@12f43f3b
import: org.codehaus.classworlds.Entry@20025374
import: org.codehaus.classworlds.Entry@f8e44ca4
import: org.codehaus.classworlds.Entry@92758522
import: org.codehaus.classworlds.Entry@ebf2705b
import: org.codehaus.classworlds.Entry@bb25e54
import: org.codehaus.classworlds.Entry@bece5185
import: org.codehaus.classworlds.Entry@3fee8e37
import: org.codehaus.classworlds.Entry@3fee19d8


this realm = plexus.core
urls[0] = file:/opt/maven-2/lib/maven-2.1.0-uber.jar
Number of imports: 10
import: org.codehaus.classworlds.Entry@a6c57a42
import: org.codehaus.classworlds.Entry@12f43f3b
import: org.codehaus.classworlds.Entry@20025374
import: org.codehaus.classworlds.Entry@f8e44ca4
import: org.codehaus.classworlds.Entry@92758522
import: org.codehaus.classworlds.Entry@ebf2705b
import: org.codehaus.classworlds.Entry@bb25e54
import: org.codehaus.classworlds.Entry@bece5185
import: org.codehaus.classworlds.Entry@3fee8e37
import: org.codehaus.classworlds.Entry@3fee19d8
-----------------------------------------------------
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Internal error in the plugin manager executing goal 'org.apache.maven.plugins:maven-eclipse-plugin:2.6:eclipse': Unable to load the mojo 'org.apache.maven.plugins:maven-eclipse-plugin:2.6:eclipse' in the plugin 'org.apache.maven.plugins:maven-eclipse-plugin'. A required class is missing: org/codehaus/plexus/resource/loader/ResourceNotFoundException
org.codehaus.plexus.resource.loader.ResourceNotFoundException

Tried running Maven with the -cpu argument but it didn't help. maven-metadata-central.xml showed the latest as 2.5.1 and others got 2.6. Fixed by deleting metadata files then re-run Maven.

Bah.

Tuesday, March 31, 2009

RTFL - Read the Fucking Logs

Read the fucking logs? Yes, it happened so many times, on so many guys. Something that I always try to avoid.

Say, you hit into a problem, you looked into the log file, you could see a bunch of error messages and stacktrace, you read the first line, you didn't bother to read the second and further.

You tried to change the configurations or something that you thought would make sense but the same (or new) error came out. You spent quite some time on it like an hour or a day.

You asked me / your supervisor to look into it and they found clear error messages or indications somewhere down the error log. You felt sorry, you found yourself stupid to waste so much time, you wished to be in the hall of shame for that day.

If this is a recurring habit of your, can you make "reading logs carefully" as a troubleshooting principle?

Thursday, March 5, 2009

404 on Nexus

Was stuck for a few minutes as Sonatype Nexus was reporting 404 while I tried to access a POM file. Expiring the cache (right clicking on the troubled repository) is the fix of it.

Thursday, February 19, 2009

Wireless Network not working on Ubuntu after Suspend/Hibernate

It never happened to me til about a month plus ago. Didn't bother to fix it 'til just now.

It's a bug reported at 53310, and it's fixed (on my machine) by doing:
modprobe -r ath_pci
modprobe ath_pci

Sunday, February 15, 2009

InflaterIjputStream.class

Exception in thread "main" java.lang.NoClassDefFoundError:
java/util/zip/InflaterInputStream
at java.util.zip.ZipFile.getInputStream(ZipFile.java:212)
at java.util.zip.ZipFile.getInputStream(ZipFile.java:180)
at java.util.jar.JarFile.hasClassPathAttribute(JarFile.java:463)
...

In the rt.jar, InflaterInputStream.class was named InflaterIjputStream.class. How could this happen? Fixed the issue by repackaging the zip.

yc

Tuesday, February 10, 2009

JVM failed with Segmentation Fault

This happened completely out of a sudden and truly random. The JVM that runs our business logic app died last night and could never be brought up anymore due to segmentation fault. (It suicided quietly)

The last few lines via strace:

DEBUG DefaultListableBeanFactory [main]: Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'
[02-10 10:22:30] DEBUG AnnotationTransactionAttributeSource [main]: Adding transactional method [createUser] with attribute [PROPAGATION_REQUIRED,ISOLATION_DEFAULT]
) = ? ERESTARTSYS (To be restarted)
+++ killed by SIGSEGV +++

It could just be a JVM bug (not exactly sure which, but suggested by John Raymond Wold, W_work in #java@irc.freenode.net) and upgrading to the newest version fixed the problem.

- yc

Sunday, November 23, 2008

Where is the log file of Eclipse TPTP Agent Controller?

I have a problem to use the integrated agent controller, which RAServer.sh reported that it has actually been running. Still finding and just learned that the logs are available at:

$TPTP_AC_HOME/config/servicelog.log

yc

Wednesday, November 12, 2008

Firefox works offline due to NetworkManager interfaces being inactive

There's one improvement in Ubuntu 8.10 which is causing me some problems - NetworkManager can now detect my HSDPA. But it doesn't work and here's the log:

Nov 12 22:32:40 kimmy pppd[9724]: Plugin /usr/lib/pppd/2.4.4/nm-pppd-plugin.so loaded.
Nov 12 22:32:40 kimmy pppd[9724]: pppd 2.4.4 started by root, uid 0
Nov 12 22:32:40 kimmy pppd[9724]: Using interface ppp0
Nov 12 22:32:40 kimmy pppd[9724]: Connect: ppp0 <--> /dev/ttyUSB0
Nov 12 22:32:40 kimmy NetworkManager: (ttyUSB0): device state change: 5 -> 6
Nov 12 22:32:40 kimmy pppd[9724]: CHAP authentication succeeded
Nov 12 22:32:40 kimmy pppd[9724]: CHAP authentication succeeded
Nov 12 22:32:40 kimmy NetworkManager: (ttyUSB0): device state change: 6 -> 7
Nov 12 22:32:40 kimmy kernel: [ 2143.619828] PPP BSD Compression module registered
Nov 12 22:32:40 kimmy kernel: [ 2143.681813] PPP Deflate Compression module registered
Nov 12 22:32:42 kimmy pppd[9724]: Modem hangup
Nov 12 22:32:42 kimmy NetworkManager: (ttyUSB0): device state change: 7 -> 9
Nov 12 22:32:42 kimmy NetworkManager: [1226500362.016832] nm_serial_device_close(): Closing device 'ttyUSB0'
Nov 12 22:32:42 kimmy pppd[9724]: Connection terminated.


Then, the supposingly working gnome-ppp will start hanging up too and in order to bring it back to live, I have to run the vodafone-mobile-connect-card-driver-for-linux:

Nov 12 22:34:03 kimmy pppd[9843]: pppd 2.4.4 started by yclian, uid 1000
Nov 12 22:34:03 kimmy pppd[9843]: using channel 7
Nov 12 22:34:03 kimmy pppd[9843]: Using interface ppp0
Nov 12 22:34:03 kimmy pppd[9843]: Connect: ppp0 <--> /dev/ttyUSB0
Nov 12 22:34:03 kimmy pppd[9843]: Warning - secret file /etc/ppp/pap-secrets has world and/or group access
Nov 12 22:34:03 kimmy pppd[9843]: sent [LCP ConfReq id=0x1 ]
Nov 12 22:34:03 kimmy pppd[9843]: rcvd [LCP ConfReq id=0x12 ]
Nov 12 22:34:03 kimmy pppd[9843]: sent [LCP ConfRej id=0x12 ]
Nov 12 22:34:03 kimmy pppd[9843]: rcvd [LCP ConfAck id=0x1 ]
Nov 12 22:34:03 kimmy pppd[9843]: rcvd [LCP ConfReq id=0x13 ]
Nov 12 22:34:03 kimmy pppd[9843]: sent [LCP ConfAck id=0x13 ]
Nov 12 22:34:03 kimmy pppd[9843]: sent [LCP EchoReq id=0x0 magic=0x0]
Nov 12 22:34:03 kimmy pppd[9843]: rcvd [LCP DiscReq id=0x14 magic=0xe0777e]
Nov 12 22:34:03 kimmy pppd[9843]: rcvd [CHAP Challenge id=0x1 <5053860912aec751b049750c32c838e8>, name = "UMTS_CHAP_SRVR"]
Nov 12 22:34:03 kimmy pppd[9843]: Warning - secret file /etc/ppp/chap-secrets has world and/or group access
Nov 12 22:34:03 kimmy pppd[9843]: sent [CHAP Response id=0x1 <2fb0aedcf34cb0db311ad1a157c5be04>, name = "admin"]
Nov 12 22:34:03 kimmy pppd[9843]: rcvd [LCP EchoRep id=0x0 magic=0xe0777e 00 00 00 00]
Nov 12 22:34:03 kimmy pppd[9843]: rcvd [CHAP Success id=0x1 ""]
Nov 12 22:34:03 kimmy pppd[9843]: CHAP authentication succeeded
Nov 12 22:34:03 kimmy pppd[9843]: CHAP authentication succeeded
...
Nov 12 22:34:08 kimmy pppd[9843]: local IP address 121.120.201.243
Nov 12 22:34:08 kimmy pppd[9843]: remote IP address 10.64.64.64
Nov 12 22:34:08 kimmy pppd[9843]: primary DNS address 58.71.136.10
Nov 12 22:34:08 kimmy pppd[9843]: secondary DNS address 58.71.132.10
Nov 12 22:34:08 kimmy pppd[9843]: Script /etc/ppp/ip-up started (pid 9845)

Now, disconnecting it again, connecting with gnome-ppp will start working:

Nov 12 22:34:24 kimmy pppd[9936]: pppd 2.4.4 started by yclian, uid 1000
Nov 12 22:34:24 kimmy pppd[9936]: using channel 8
Nov 12 22:34:24 kimmy pppd[9936]: Using interface ppp0
Nov 12 22:34:24 kimmy pppd[9936]: Connect: ppp0 <--> /dev/ttyUSB0
Nov 12 22:34:24 kimmy pppd[9936]: Warning - secret file /etc/ppp/pap-secrets has world and/or group access
Nov 12 22:34:24 kimmy pppd[9936]: sent [LCP ConfReq id=0x1 ]
Nov 12 22:34:24 kimmy pppd[9936]: rcvd [LCP ConfReq id=0x15 ]
Nov 12 22:34:24 kimmy pppd[9936]: sent [LCP ConfRej id=0x15 ]
Nov 12 22:34:24 kimmy pppd[9936]: rcvd [LCP ConfAck id=0x1 ]
Nov 12 22:34:24 kimmy pppd[9936]: rcvd [LCP ConfReq id=0x16 ]
Nov 12 22:34:24 kimmy pppd[9936]: sent [LCP ConfAck id=0x16 ]
Nov 12 22:34:24 kimmy pppd[9936]: sent [LCP EchoReq id=0x0 magic=0x0]
Nov 12 22:34:24 kimmy pppd[9936]: rcvd [LCP DiscReq id=0x17 magic=0xe0cb68]
Nov 12 22:34:24 kimmy pppd[9936]: rcvd [CHAP Challenge id=0x1 <7c2c8c8e00cabc94481272f65eb30ebb>, name = "UMTS_CHAP_SRVR"]
Nov 12 22:34:24 kimmy pppd[9936]: Warning - secret file /etc/ppp/chap-secrets has world and/or group access
Nov 12 22:34:24 kimmy pppd[9936]: sent [CHAP Response id=0x1 , name = "maxis"]
Nov 12 22:34:24 kimmy pppd[9936]: rcvd [LCP EchoRep id=0x0 magic=0xe0cb68 00 00 00 00]
Nov 12 22:34:24 kimmy pppd[9936]: rcvd [CHAP Success id=0x1 ""]
Nov 12 22:34:24 kimmy pppd[9936]: CHAP authentication succeeded
Nov 12 22:34:24 kimmy pppd[9936]: CHAP authentication succeeded
...
Nov 12 22:34:27 kimmy pppd[9936]: local IP address 121.120.187.27
Nov 12 22:34:27 kimmy pppd[9936]: remote IP address 10.64.64.64
Nov 12 22:34:27 kimmy pppd[9936]: primary DNS address 58.71.136.10
Nov 12 22:34:27 kimmy pppd[9936]: secondary DNS address 58.71.132.10
Nov 12 22:34:27 kimmy pppd[9936]: Script /etc/ppp/ip-up started (pid 9938)

That's not annoying enough. NetworkManager now marks my network as inactive unless I'm connected either to eth0 or wifi0, which I did not have to do in the past. The consequence? Every time when I start Firefox, it works offline.

I found out that there're other users that are facing similar issue, like in question #28829. I did not use the NetworkManager.conf workaround as suggested in the page since I'm not familiar with the dbus stuff, but looking at the file gave me a clue that running Firefox as root would fix the problem. That was right but who would want to do that? ;-)

A better solution would definitely be altering Firefox settings. Question #96 suggests to set network.online to true but it already is! Then I saw toolkit.networkmanager.disable and toggled it to true, restarted Firefox and.. Yes, this is the solution, it disables Firefox from consulting the NetworkManager.

Read the knowledge base if you want to know more about it.

- yc

Thursday, September 18, 2008

Unable to open this mailbox

I just set up courier-imap on my machine but I couldn't open the INBOX:
2 SELECT INBOX
2 NO Unable to open this mailbox.
I thought it would be a permission problem but the dirs are set with 700. I also read that it could be the server's date time, which didn't seem to be the case at all.. I then bumped into this thread in the Ubuntu forum to find out that I should have used maildirmake command to create the maildir, bah.

- yc

Saturday, August 2, 2008

Can't Delete Recurring Events in Google Calendar

In my Google Calendar, I have a bunch of recurring events from a project calendar that were moved to my default calendar when the calendar was removed, strange. When I tried to delete them by selecting "All Events in the Series", it came back with an unhelpful error message: "An error has occurred. Please try again later."

I followed the suggestion in the mailing list and it managed to solve my problem. Basically,
  1. Export my calendar to an iCal file.
  2. Delete my calendar / all events of it.
  3. Import the iCal into my calendar.
- yc

Wednesday, July 23, 2008

Ubuntu Hardy Update Freezes during "Generating locales..."

I was upgrading a Ubuntu machine at work yesterday, it froze while it set up the locales:
Setting up locales (2.7.9-4) ...
Generating locales...
en_AU.UTF-8...

(you can go for a coffee now, like, taking a shower and drive down to the town to buy it from Starbucks)

I killed dpkg and restarted the set up but it didn't help. More errors while after packages were being set up:
perl: warning: Setting locale failed.

I didn't get a good response from the #ubuntu channel but some Googling got me to bump into this forum topic. There are a number of solutions being suggested in the topic, what worked for me was by booting into the recovery mode to run the package manager again.

- yc

Saturday, June 28, 2008

'publickey' SSH Authorization fails if 'authorized_keys' file is writable by non-owners

I didn't realize this. SSH kept prompting me to fill in password even though I forced it to use just 'publickey' authorization:

$ ssh -i id_kimmy somewhere.com -v
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering public key: /home/yclian/.ssh/id_rsa
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /home/yclian/.ssh/identity
debug1: Trying private key: /home/yclian/.ssh/id_dsa
debug1: Next authentication method: password
yclian@somewhere.com's password:

ssh -i id_kimmy somewhere.com -o 'PreferredAuthentications publickey' -v
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering public key: /home/yclian/.ssh/id_rsa
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /home/yclian/.ssh/identity
debug1: Trying private key: /home/yclian/.ssh/id_dsa
debug1: No more authentication methods to try.
Permission denied (publickey,password).

Fixed by revoking write permissions (chmod 700) to the authrozied_keys file. Very simple logic, brrr.

Some links that I came across:

- yc

Sunday, December 30, 2007

3 Solutions to GNOME/VNC keyboard mapping issue

I am trying to connect to my workstation in the office via vncviewer and I got scrambled keys in GNOME before I applied one of the fixes below. This has bugged me for more than a week and Google couldn't really give me a good answer until I searched for:

asdf abfh vnc

Try.

It is a bug reported at #108928 and duplicated at #112955. Appears more like a GNOME issue than a VNC issue.

Solution #1: Use vnc4server -extension XFIXES

No, I did not try this because I simply do not want to change my client. The workaround basically requires you to remove tightvncserver and use vnc4server instead. Refer to this and this for more information.

Solution #2: Avoid executing gnome-session

Instead of running gnome-session, run the following commands in your xstartup script or manually in xterm:

gnome-wm &
gnome-panel &
gnome-cups-icon &
gnome-volume-manager &

Suggested by Randy at this link.

Solution #3: Reset the keyboard layout via gconf-editor

This solution works the best in my opinion, suggested by Will at this link. Open up gconf-editor in your X then navigate to:

desktop > gnome > peripherals > keyboard > kbd

You will probably be seeing empty value [] or [us] for the layouts. Enter anything say foo, close the application and your problem should now be fixed.

- yc, one problem in life down

Monday, October 29, 2007

Cp1252 Nightmare

It was a horrible experience. Spending more than an hour to recreate workspaces and reimport projects, just to get rid of the strange Eclipse build error:

The project was not build since the source file ${path} could not be read

I did not have any problems to compile the code using Maven though.. So, why was Eclipse complaining? Some search results in Google suggested to me that it could be a file encoding issue. I was pretty sure that would be the case since the code might be checked in by someone on a Windows machine.

I switched to my Windows environment and the code could be successfully built.

Well, well.. but what's the solution? After being annoyed by the error for more than an hour, I slammed Eclipse by forcing the project to use Cp1252 encoding and dramatically the build works. Now, changing the text file encoding back to UTF-8 works too (which previously did not).

Why?

- yc, pwnz0r

Sunday, October 21, 2007

Ubuntu 7.10 - Gutsy Gibbon with XGL

Upgraded my Ubuntu to 7.10 yesterday, the coolest add-on to it is the support of Compiz Fusion (Compiz effects came in at 7.04 actually). Some of you might have seen the effects, which I will briefly walk through those that I have experienced later before I end this short blog entry.

A few problems that I experienced after the upgrade were:

  1. Restricted drivers manager not working. It said something like this:
    You need to install the package linux-restricted-modules-* for this program to work.
    Solution: Install the restricted module, e.g.
    apt-get install linux-restricted-modules-2.6.22-14-generic

  2. Couldn't turn on Compiz effects via System -> Preferences -> Appearance -> Visual Effects. It said something like:
    Desktop effects could not be enabled
    Solution: Turn on "Composite" in /etc/X11/xorg.conf, i.e.
    Section "Extensions"
    Option "Composite" "1"

    However, before that, you have to install the GL based X server, i.e.
    apt-get install xserver-xgl

    Then, restart your X server (ALT + CTRL + Backspace) after you have made configuration changes.

  3. IDE and Java applications such as IntelliJ and Netbeans were broken with blank swing interface. I noticed that the menus were still working when I moved my mouse over them.

    Solution: Set AWT_TOOLKIT to MToolkit, for instance, add this entry to /etc/profile:
    export AWT_TOOLKIT="MToolkit"
    Then, reload the profile (source <profile>) and restart your IDE.

To find out what can Compiz effects do, please take a look at this Youtube video. I noticed and managed to discover some newly added effects:
  1. Shadow effects
  2. Maximize and Minimize effects
  3. Blinking/fading effects caused by error/alert, e.g. backspace on an empty text box in Pidgin; filling in invalid phrase in Firefox search box;
  4. Wobbly window effects while it's dragged
  5. Transparent effects (use ALT + Wheel Scroll on a window)
  6. ALT + Tab with real-time snapshots
  7. M$ + E to choose desktops
  8. M$ + Wheel Scroll to zoom
  9. M$ + Right Click to zoom in once

Read these to discover more:
  1. Compiz documentation
  2. Novel - Xgl on Suse 10.1 (see Xgl Shortcuts section)

- yc, impressed