• 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30

The edge version of do_postgres with JRuby causes misterious error like this.

pre>>
~ (1) SELECT "id", "digest", "fetched_at", "created_at", "site_id" FROM "pages" WHERE ("site_id" IN (1)) ORDER BY "id"
~ ERROR: syntax error at or near "("merb : worker (port 4000) ~ ERROR: syntax error at or near "(" - (PostgresError)
<<--

The SQL that had been performed is here.

sql>>
SELECT "id", "digest", "fetched_at", "created_at", "site_id" FROM "pages" WHERE ("site_id" IN (1)) ORDER BY "id"
<<--

This is able to be performed successfully at the psql console.
So I wonder what the error message means.

Updates

I found the bug.

For example, this code

pre>>
Page.repository.adapter.execute('SELECT * FROM "pages" WHERE ("id" IN ?) AND ("site_id" = ?)', [1], nil)
<<--

generates this sql

sql>>
SELECT * FROM "pages" WHERE ("id" IN (1)) AND ("site_id" = (NULL))
<<--

(NULL) causes parsing error.

This issue happens if the first value is an Array and the succeeding values are not Arrays.

posted by takiuchi takiuchi on Sun 7 Jun 2009 at 20:06 with 0 comments

xxxx_controller.rbはXxxxControllerが定義されているべき、
というようなエラーメッセージが出た場合、
XxxxControllerのクラス定義のなかでエラーが発生している
事が原因だったりするみたいですね。

お手製の acts_as_xxxxx を使ってたりする場合、
その辺でエラーを出してないかチェックすると良いようです。

posted by genki genki on Sun 9 Dec 2007 at 05:44 with 0 comments

aptitude update したらこんなエラーメッセージが出たので、対処法をメモ。

/etc/apt/apt.conf.d/70debconf

ini>>
APT::Cache-Limit 100000000;
<<--

後は普通に aptitude update でOK。

posted by genki genki on Sat 1 Dec 2007 at 00:15 with 0 comments