Personal tools
You are here: Home Zope&Plone Tips Plone 2.1.3 -> 2.5.1 アップグレード
Document Actions

Plone 2.1.3 -> 2.5.1 アップグレード

by maru last modified 2006-10-28 20:42

Plone 2.1.3 から 2.5.1 アップグレードしてみました

【環境】

  • Python-2.3.5 (Linux) → Python-2.4.3 (Linux)
  • Zope-2.8.6-final (Linux) → Zope-2.9.5-final (Linux)
  • Plone-2.1.3 → Plone-2.5.1
  • ATPhoto-1-0-alpha1 → ATPhoto-1-0-alpha1 build 53
  • COREBlog2-0.9b → COREBlog2 nightly(0.9b?)

 アップグレードのきっかけは Plone-2.1.3 で(Apacheでrewriteしてると?)リモートIPが記録されないので、コメント、トラックバックSpamを送ったヴァカのIPが吸い出せない問題があったのでやってみようと。まぁ、これだけの問題回避であれば 2.1.4 にすれば終わるのですが、ものはついでなんで一気に 2.5.x系 にしてみることに。まぁこれがエライ騒ぎになったわけですがww

 まずはPloneからさっくりアップグレード。ところがどっこいうさぎさん。これが芋づる式に全システムアップグレードへと発展(笑)。

  1. Plone-2.5.1 に必要な環境は Zope-2.8.7 以降。
  2. これでも一応 Zope に同梱されている Five を使えば動くみたいだがスマートでないので Zope も 2.9.x へ移行。
  3. Zope2.9.x にすると今度はPythonがダメ。要求環境は Python-2.4.x 。よってPythonからアップグレード。

とまぁこんな感じでした。

Pythonアップグレード

 旧環境も残しておきたいので、別ディレクトリにtar玉(Python-2.4.3.tgz)からインストール。 /opt/python2.4.3 配下へ。

[root@ns1 Python-2.4.3]# ./configure -prefix=/opt/python2.4.3
~result略~
[root@ns1 Python-2.4.3]# make
~result略~
[root@ns1 Python-2.4.3]# make install

んで、以下の必要なsite-packageをそれぞれ「/opt/python2.4.3/bin/python setup.py install」でインストール。

  • PIL(Imaging-1.1.5.tar.gz)
  • JapaneseCodecs(JapaneseCodecs-1.4.11.tar.gz)
  • simplejson(simplejson-1.4.tar.gz) ※FriendlyAlbumを使わないならいらない
  • egenix-mx-base(egenix-mx-base-2.0.6.tar.gz) ※多分psycopg関係。使わないが一応。
  • ElementTree(elementtree-1.2.6-20050316.tar.gz) ※新環境でZope立ち上げたらこれがないって警告喰らった

あと、PILに必要な jpegsrc.v6b.tar.gz や、zlib-1.2.2.tar.gz はすでに入ってるので省略。

Zopeアップグレード

 これもPyhtonと同様、別ディレクトリ(/usr/local/zope/Zope-2.9.5)へ。これもtar玉(Zope-2.9.5-final.tgz)から。

[root@ns1 Zope-2.9.5-final]# ./configure --prefix=/usr/local/zope/Zope-2.9.5 \
[root@ns1 Zope-2.9.5-final]# --with-python=/opt/python2.4.3/bin/python
~result略~
[root@ns1 Zope-2.9.5-final]# make
~result略~
[root@ns1 Zope-2.9.5-final]# make install
~result略~
[root@ns1 Zope-2.9.5-final]# cd /usr/local/zope/Zope-2.9.5/bin
[root@ns1 bin]# ./python ./makezopeinstance.py -d /var/zope/Zope-2.9.5 -u hoge:hogehoge
[root@ns1 bin]# cd /var/zope
[root@ns1 bin]# chown -R hoge:hoge Zope-2.9.5

これでインストール&初期インスタンス生成完了。zope.conf のDirectiveは取りあえず以下を変更。

# Directive: effective-user
effective-user hoge ※一応伏せときますがzope用userだす

# Directive: dns-server
dns-server 127.0.0.1

# Directives: servers
<http-server>
# valid keys are "address" and "force-connection-close"
address hogeport ※これも一応伏せとく
# force-connection-close on
</http-server>

Ploneアップグレード&各Productインスコ&起動

 んで使用してる以下のProductを /var/zope/Zope-2.9.5/Products に展開。

 あとは、旧環境の var/配下の全ファイル、FileSystemStorageで使用してるディレクトリ&全ファイル(つか、bin.、etc、Products、log以外の全でぃれくとり)を新環境にこぴって zopectl start。

Migrationとか

 Migrationについては Plone2.5.1-rc1へのアップグレード を参照して実施して、プロダクトを追加・削除画面にて各Productを再インストール。Firefoxだとなんか出来なかった(再インストールしたあとの画面がおかしい…)のでIEでやった。

プロダクトを追加・削除画面

これで終わりだ~と思いきや、COREBlog2 と ATPhotoで問題発生orz

COREBlog2での問題

 blogへアクセスしたらいきなりですよorz

その1 UnicodeDecodeError

Site Error

An error was encountered while publishing this resource.

UnicodeDecodeError
Sorry, a site error occurred.

Traceback (innermost last):

* Module ZPublisher.Publish, line 196, in publish_module_standard
* Module Products.PlacelessTranslationService.PatchStringIO, line 34, in new_publish
* Module ZPublisher.Publish, line 146, in publish
* Module Zope2.App.startup, line 222, in zpublisher_exception_hook
* Module ZPublisher.Publish, line 115, in publish
* Module ZPublisher.mapply, line 88, in mapply
* Module ZPublisher.Publish, line 41, in call_object
* Module Shared.DC.Scripts.Bindings, line 311, in __call__
* Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec
* Module Products.CMFCore.FSPageTemplate, line 195, in _exec
* Module Products.CMFCore.FSPageTemplate, line 134, in pt_render
* Module Products.PageTemplates.PageTemplate, line 104, in pt_render

* Module TAL.TALInterpreter, line 238, in __call__
* Module TAL.TALInterpreter, line 281, in interpret
* Module TAL.TALInterpreter, line 749, in do_useMacro
* Module TAL.TALInterpreter, line 281, in interpret
* Module TAL.TALInterpreter, line 457, in do_optTag_tal
* Module TAL.TALInterpreter, line 442, in do_optTag
* Module TAL.TALInterpreter, line 437, in no_tag
* Module TAL.TALInterpreter, line 281, in interpret
* Module TAL.TALInterpreter, line 780, in do_defineSlot
* Module TAL.TALInterpreter, line 281, in interpret
* Module TAL.TALInterpreter, line 715, in do_condition
* Module TAL.TALInterpreter, line 281, in interpret
* Module TAL.TALInterpreter, line 780, in do_defineSlot
* Module TAL.TALInterpreter, line 281, in interpret
* Module TAL.TALInterpreter, line 457, in do_optTag_tal
* Module TAL.TALInterpreter, line 442, in do_optTag
* Module TAL.TALInterpreter, line 437, in no_tag
* Module TAL.TALInterpreter, line 281, in interpret
* Module TAL.TALInterpreter, line 749, in do_useMacro
* Module TAL.TALInterpreter, line 281, in interpret
* Module TAL.TALInterpreter, line 715, in do_condition
* Module TAL.TALInterpreter, line 281, in interpret
* Module TAL.TALInterpreter, line 457, in do_optTag_tal
* Module TAL.TALInterpreter, line 442, in do_optTag
* Module TAL.TALInterpreter, line 437, in no_tag
* Module TAL.TALInterpreter, line 281, in interpret
* Module TAL.TALInterpreter, line 691, in do_loop_tal
* Module TAL.TALInterpreter, line 281, in interpret
* Module TAL.TALInterpreter, line 457, in do_optTag_tal
* Module TAL.TALInterpreter, line 442, in do_optTag
* Module TAL.TALInterpreter, line 437, in no_tag
* Module TAL.TALInterpreter, line 281, in interpret
* Module TAL.TALInterpreter, line 457, in do_optTag_tal
* Module TAL.TALInterpreter, line 442, in do_optTag
* Module TAL.TALInterpreter, line 437, in no_tag
* Module TAL.TALInterpreter, line 281, in interpret
* Module TAL.TALInterpreter, line 715, in do_condition
* Module TAL.TALInterpreter, line 281, in interpret
* Module TAL.TALInterpreter, line 457, in do_optTag_tal
* Module TAL.TALInterpreter, line 442, in do_optTag
* Module TAL.TALInterpreter, line 437, in no_tag
* Module TAL.TALInterpreter, line 281, in interpret
* Module TAL.TALInterpreter, line 749, in do_useMacro
* Module TAL.TALInterpreter, line 281, in interpret
* Module TAL.TALInterpreter, line 715, in do_condition
* Module TAL.TALInterpreter, line 281, in interpret
* Module TAL.TALInterpreter, line 691, in do_loop_tal
* Module TAL.TALInterpreter, line 281, in interpret
* Module TAL.TALInterpreter, line 457, in do_optTag_tal
* Module TAL.TALInterpreter, line 442, in do_optTag
* Module TAL.TALInterpreter, line 437, in no_tag
* Module TAL.TALInterpreter, line 281, in interpret
* Module TAL.TALInterpreter, line 531, in do_insertText_tal
* Module Products.PageTemplates.TALES, line 227, in evaluateText
* Module Products.PageTemplates.TALES, line 221, in evaluate
URL: file:COREBlog2/skins/COREBlog2/portlet_recent_comment.pt
Line 34, Column 16
Expression: standard:'obj/author'
Names:

{'container': ,
'context': ,
'default': ,
'here': ,
'loop': ,
'modules': ,
'nothing': None,
'options': {'args': ()},
'repeat': ,
'request': ,
'root': ,
'template': ,
'traverse_subpath': [],
'user': }

* Module Products.PageTemplates.Expressions, line 185, in __call__
* Module Products.PageTemplates.Expressions, line 173, in _eval
* Module Products.PageTemplates.Expressions, line 127, in _eval
__traceback_info__: obj
* Module Products.PageTemplates.Expressions, line 295, in restrictedTraverse
__traceback_info__: {'path': ['author'], 'TraversalRequestNameStack': []}

UnicodeDecodeError: 'ascii' codec can't decode byte 0xe3 in position 0: ordinal not
 in range(128) (Also, the following error occurred while attempting to render the
 standard error message, please see the event log for full details: 'ascii' codec
 can't decode byte 0xe3 in position 0: ordinal not in range(128))

…なんだこれ(;´Д`)。google神に問い合わせてみたところ、 これ を発見。かなりバージョンが違いますが取りあえず実施。

import sys
sys.setdefaultencoding("utf-8")

の内容のファイルを以下に保存
/usr/local/zope/Zope-2.9.5/lib/python/sitecustomize.py

リスタートすると問題解決…したんですが、

その2 Comment表示するとログイン画面に

 うーむ。blogコメントがあるコンテンツを表示させるとのきなみ↓の画面になってしまうのです…。

Comment表示するとこの画面…

もうさらに訳わからん…。エラーログも出ないしorz 取りあえずググってみるとさきほどの Plone2.5.1-rc1へのアップグレード の追記に行き着く。ソース修正してもいいんですが新しいバージョンがないかと探してみると、 COREBlog2-0.9b nightly なるものを発見。diffったら同じ修正が入ってるのでこれを投入。

 これでCOREBlog2に関する全問題解決(…だと思う)。

ATPhotoでの問題

 …Firefox上で文字化けです(IEはおk)orz Album全滅、PhotoはSlideshowで動かすと文字化けする。

Albumで文字化けPhotoで文字化け

 この辺の表示データはどっから持ってきてるか調べたら、http://(Album、PhotoのURL)/slideshow_contents.js かららしい。こいつ自体はutf-8のファイルなんだが…。でも、ブラウザ(Firefox)ではファイルをISO-8859-15でエンコードしようとしてる。デフォルトエンコードの問題?と言うわけでgoogle神登場。んで zope2.9.0のdefault-zpublisher-encoding 発見。あーこれだ間違いない。

 ということで zope.conf を以下のようにに変更(エンコードに関連するっぽいのは全部変えて超ガチガチ仕様)。

# Directive: rest-input-encoding
rest-input-encoding utf-8

# Directive: rest-output-encoding
rest-output-encoding utf-8

# Directive: rest-language-code
rest-language-code ja

# Directive: default-zpublisher-encoding
default-zpublisher-encoding utf-8

取りあえず動いてるっぽいが…

 まだ本格稼働せずLocalにて検証中。致命的な害ではなさそうだが↓なエラーログがボンボン出てる。…なんなのさこれorz

2006-10-28T10:42:23 ERROR root Exception while rendering an error message
Traceback (most recent call last):
File "/usr/local/zope/Zope-2.9.5/lib/python/OFS/SimpleItem.py", line 223,
 in raise_standardErrorMessage
v = s(**kwargs)
File "/var/zope/Zope-2.9.5/Products/CMFCore/FSPythonScript.py", line 108, in __call__
return Script.__call__(self, *args, **kw)
File "/usr/local/zope/Zope-2.9.5/lib/python/Shared/DC/Scripts/Bindings.py", line 311,
 in __call__
return self._bindAndExec(args, kw, None)
File "/usr/local/zope/Zope-2.9.5/lib/python/Shared/DC/Scripts/Bindings.py", line 348,
 in _bindAndExec
return self._exec(bound_data, args, kw)
File "/var/zope/Zope-2.9.5/Products/CMFCore/FSPythonScript.py", line 164, in _exec
result = f(*args, **kw)
File "Script (Python)", line 16, in standard_error_message
File "/usr/local/zope/Zope-2.9.5/lib/python/Shared/DC/Scripts/Bindings.py", line 311,
 in __call__
return self._bindAndExec(args, kw, None)
File "/usr/local/zope/Zope-2.9.5/lib/python/Shared/DC/Scripts/Bindings.py", line 348,
 in _bindAndExec
return self._exec(bound_data, args, kw)
File "/var/zope/Zope-2.9.5/Products/CMFCore/FSPageTemplate.py", line 195, in _exec
result = self.pt_render(extra_context=bound_names)
File "/var/zope/Zope-2.9.5/Products/CMFCore/FSPageTemplate.py", line 134, in pt_render
result = FSPageTemplate.inheritedAttribute('pt_render')(
File "/usr/local/zope/Zope-2.9.5/lib/python/Products/PageTemplates/PageTemplate.py",
 line 104, in pt_render
tal=not source, strictinsert=0)()
File "/usr/local/zope/Zope-2.9.5/lib/python/TAL/TALInterpreter.py", line 238, in __call__
self.interpret(self.program)
File "/usr/local/zope/Zope-2.9.5/lib/python/TAL/TALInterpreter.py", line 281,
 in interpret
handlers[opcode](self, args)
File "/usr/local/zope/Zope-2.9.5/lib/python/TAL/TALInterpreter.py", line 749,
 in do_useMacro
self.interpret(macro)
File "/usr/local/zope/Zope-2.9.5/lib/python/TAL/TALInterpreter.py", line 281,
 in interpret
handlers[opcode](self, args)
File "/usr/local/zope/Zope-2.9.5/lib/python/TAL/TALInterpreter.py", line 457,
 in do_optTag_tal
self.do_optTag(stuff)
File "/usr/local/zope/Zope-2.9.5/lib/python/TAL/TALInterpreter.py", line 442,
 in do_optTag
return self.no_tag(start, program)
File "/usr/local/zope/Zope-2.9.5/lib/python/TAL/TALInterpreter.py", line 437,
 in no_tag
self.interpret(program)
File "/usr/local/zope/Zope-2.9.5/lib/python/TAL/TALInterpreter.py", line 281,
 in interpret
handlers[opcode](self, args)
File "/usr/local/zope/Zope-2.9.5/lib/python/TAL/TALInterpreter.py", line 749,
 in do_useMacro
self.interpret(macro)
File "/usr/local/zope/Zope-2.9.5/lib/python/TAL/TALInterpreter.py", line 281,
 in interpret
handlers[opcode](self, args)
File "/usr/local/zope/Zope-2.9.5/lib/python/TAL/TALInterpreter.py", line 511,
 in do_setGlobal_tal
self.engine.setGlobal(name, self.engine.evaluateValue(expr))
File "/usr/local/zope/Zope-2.9.5/lib/python/Products/PageTemplates/TALES.py", line 221,
 in evaluate
return expression(self)
File "/usr/local/zope/Zope-2.9.5/lib/python/Products/PageTemplates/Expressions.py",
 line 185, in __call__
return self._eval(econtext)
File "/usr/local/zope/Zope-2.9.5/lib/python/Products/PageTemplates/Expressions.py",
 line 173, in _eval
ob = self._subexprs[-1](econtext)
File "/usr/local/zope/Zope-2.9.5/lib/python/Products/PageTemplates/Expressions.py",
 line 127, in _eval
ob = restrictedTraverse(ob, path, getSecurityManager())
File "/usr/local/zope/Zope-2.9.5/lib/python/Products/PageTemplates/Expressions.py",
 line 286, in restrictedTraverse
o=t(REQUEST, name)
File "/var/zope/Zope-2.9.5/Products/ResourceRegistries/tools/BaseRegistry.py",
 line 151, in __bobo_traverse__
raise AttributeError('%s' % (name,))
AttributeError: @@plone