amashigeseiji / opFileManagePlugin

file upload for OpenPNE3 http://plugins.openpne.jp/package/opFileManagePlugin
4 stars 0 forks source link

#質問  #8

Closed ghost closed 9 years ago

ghost commented 10 years ago

プラグイン同梱版OpenPNE-3.8.12 プラグインをインストールします。 $ ./symfony opPlugin:install opFileManagePlugin -r 0.8.1

モデルとデータベースの更新をします。 $ ./symfony openpne:migrate --target=opFileManagePlugin

とすると、TABLEエラーがでるんですが、

なにか心当たりがあれば教えてください。

amashigeseiji commented 10 years ago

@ikunikun さん ご質問ありがとうございます。

たぶん自分がマイグレーションスクリプトを正常に書いてないのが理由だとおもいます。

本来なら、リリースの際にDBの構造を変えるときにはマイグレーションスクリプトとテーブル構造のリビジョンを指定するのですが、自分としては開発版の想定だったので、正式版をリリースする際にマイグレーションとリビジョン指定のファイルを追加しようと考えていました。そうこうするうちに開発への情熱を失って放置してしまっている状態なのですが…。

エラーが出ている理由としては、たぶん

といったことではないかとおもいます。 こういった問題をハンドリングするためにリビジョン番号の指定とマイグレーションスクリプトの記述を開発者がするべきなのですが、まだ正式リリースじゃないつもりでやっていたので、DB自力で作り替えてください、くらいのつもりでした。

とりあえず放置するにしても、実際にユーザーがいるのであればこのへんの問題くらいは解消して放置すべきですね…。

ghost commented 10 years ago

作者様  ということはエラーの吐くテーブルをドロップしてしまっても大丈夫という感じでしょうか? 今回使うテーブルは、完全新規で作成されたのかおしえてください。

ghost commented 10 years ago

もしくはSQLが記述してある箇所さえ教えていただければ、なんとかします。 よろしくお願いいたします。

amashigeseiji commented 10 years ago

このプラグインで利用するテーブルは、 plugins/opFileManagePlugin/config/doctrine/schema.yml で定義されています。完全にアンインストールする場合には、ここに記載のテーブル(managed_file, file_directory, directory_config の3つ)はすべて削除していただいても大丈夫です。

ghost commented 10 years ago

ありがとうございます!!!! ちなみに アップロード失敗時にでる (アップ先フォルダがないため?) 現在、サーバが混み合っているか、メンテナンス中です。 ご迷惑をおかけいたしますが、しばらく時間を空けて再度アクセスしてください。 というのも情報を知っていれば教えてください。いそがしいなかすいません!!! よろしくお願いします

amashigeseiji commented 10 years ago

アップロード失敗時にでる 現在、サーバが混み合っているか、メンテナンス中です。 ご迷惑をおかけいたしますが、しばらく時間を空けて再度アクセスしてください。

これは詳細なエラーメッセージみないとなんともいえないですね。 devモードでみるとどんなエラー内容になっているでしょうか?(devモードについては http://openpne3.com/wiki/OpenPNE3ノウハウ:メンテナンス表示・真っ白な画面が出た時の対処法 を参照してください。 https://github.com/openpne/OpenPNE3/blob/master/web/pc_frontend_dev.php ←こんなファイルを web ディレクトリに配置します)

ちなみに必要なアップロード先必要なフォルダもあればおしえてください。

こちらは質問の意図がわかりかねますが、「必要なアップロード先」とはファイルがフォルダに格納されると想定してのことでしょうか?そうでしたら、OpenPNE はファイルをデータベースにバイナリで突っ込んでいるという回答になります(file_binテーブルというテーブルです)。

ghost commented 10 years ago

なるほど詳細に教えていただきありがとうございます。

managed_file, file_directory, directory_config のエラーもでることもなくなりました。

仕組みとしえてはDBにデータを入れてらっしゃるのですね、

また潜ってさがしてみます。いろいろありがとうございました。今日はねるです

失礼します

ghost commented 10 years ago

500 | Internal Server Error | InvalidArgumentException The "/f/show/:filename" route has some missing mandatory parameters (:filename). stack trace

at ()
in SF_ROOT_DIR/lib/vendor/symfony/lib/routing/sfRoute.class.php line 224 ...
            // all params must be given
            if ($diff = array_diff_key($this->variables, $tparams))
            {
              throw new InvalidArgumentException(sprintf('The "%s" route has some missing mandatory parameters (%s).', $this->pattern, implode(', ', $diff)));
            }
            if ($this->options['generate_shortest_url'] || $this->customToken)
at sfRoute->generate(array('sf_subject' => object('sfOutputEscaperIteratorDecorator')), array('path_info' => '/directory/5', 'prefix' => '/pc_frontend_dev.php', 'method' => 'GET', 'format' => null, 'host' => 'ss.initc.mobi', 'is_secure' => , 'request_uri' => 'http://ss.initc.mobi/pc_frontend_dev.php/directory/5'), )
in SF_ROOT_DIR/lib/vendor/symfony/lib/routing/sfRequestRoute.class.php line 105 ...
at sfRequestRoute->generate(array('sf_subject' => object('sfOutputEscaperIteratorDecorator')), array('path_info' => '/directory/5', 'prefix' => '/pc_frontend_dev.php', 'method' => 'GET', 'format' => null, 'host' => 'ss.initc.mobi', 'is_secure' => , 'request_uri' => 'http://ss.initc.mobi/pc_frontend_dev.php/directory/5'), )
in SF_ROOT_DIR/lib/vendor/symfony/lib/routing/sfPatternRouting.class.php line 327 ...
at sfPatternRouting->generate('file_show', array('sf_subject' => object('sfOutputEscaperIteratorDecorator')), )
in SF_ROOT_DIR/lib/vendor/symfony/lib/controller/sfWebController.class.php line 74 ...
at sfWebController->genUrl(array('sf_route' => 'file_show', 'sf_subject' => object('sfOutputEscaperIteratorDecorator')), )
in SF_ROOT_DIR/lib/vendor/symfony/lib/helper/UrlHelper.php line 100 ...
at url_for1(array('sf_route' => 'file_show', 'sf_subject' => object('sfOutputEscaperIteratorDecorator')), )
in n/a line n/a ...
at call_user_func_array('url_for1', array(array('sf_route' => 'file_show', 'sf_subject' => object('sfOutputEscaperIteratorDecorator')), ))
in SF_ROOT_DIR/lib/vendor/symfony/lib/helper/UrlHelper.php line 127 ...
at url_for(array('sf_route' => 'file_show', 'sf_subject' => object('sfOutputEscaperIteratorDecorator')), )
in SF_ROOT_DIR/lib/vendor/symfony/lib/helper/UrlHelper.php line 51 ...
at link_to1('4d692cc6.jpg', array('sf_route' => 'file_show', 'sf_subject' => object('sfOutputEscaperIteratorDecorator')), array())
in SF_ROOT_DIR/lib/vendor/symfony/lib/helper/UrlHelper.php line 27 ...
at link_to2('4d692cc6.jpg', 'file_show', object('sfOutputEscaperIteratorDecorator'))
in n/a line n/a ...
at call_user_func_array('link_to2', array('4d692cc6.jpg', 'file_show', object('sfOutputEscaperIteratorDecorator')))
in SF_ROOT_DIR/lib/vendor/symfony/lib/helper/UrlHelper.php line 188 ...
at link_to('4d692cc6.jpg', 'file_show', object('sfOutputEscaperIteratorDecorator'))
in SF_ROOT_DIR/plugins/opFileManagePlugin/apps/pc_frontend/modules/file/templates/_fileListRow.php line 3 ...
at require('/var/www/html/open/StrangeWorld/OpenPNE3/plugins/opFileManagePlugin/apps/pc_frontend/modules/file/templates/_fileListRow.php')
in SF_ROOT_DIR/lib/vendor/symfony/lib/view/sfPHPView.class.php line 75 ...
at sfPHPView->renderFile('/var/www/html/open/StrangeWorld/OpenPNE3/plugins/opFileManagePlugin/apps/pc_frontend/modules/file/templates/_fileListRow.php')
in SF_ROOT_DIR/lib/vendor/symfony/lib/view/sfPartialView.class.php line 124 ...
at sfPartialView->render()
in SF_ROOT_DIR/lib/vendor/symfony/lib/helper/PartialHelper.php line 218 ...
at get_partial('file/fileListRow', array('file' => object('sfOutputEscaperIteratorDecorator')))
in SF_ROOT_DIR/lib/vendor/symfony/lib/helper/PartialHelper.php line 180 ...
at include_partial('file/fileListRow', array('file' => object('sfOutputEscaperIteratorDecorator')))
in SF_ROOT_DIR/plugins/opFileManagePlugin/apps/pc_frontend/modules/directory/templates/showSuccess.php line 32 ...
at require('/var/www/html/open/StrangeWorld/OpenPNE3/plugins/opFileManagePlugin/apps/pc_frontend/modules/directory/templates/showSuccess.php')

となりました

ghost commented 10 years ago

(ver OpenPNE38x_PluginBundledVersion-zip-OpenPNE-3.8.12 )   特定ページでの SSL を使用するかどうか(config/OpenPNE.yml) 設定にすべて SSLを使わない設定にしたら上手くいきました。 ありがとうございます。 まとめるとSSLなし、TABLE初期化から インストールすればなかなかインストールは上手くいきそうです(プラグイン同封版) たすかりました。またよろしくお願いいたします。

amashigeseiji commented 10 years ago

おっと。なにやら原因はわかりませんが問題が解決なさったようでよかったです!

ghost commented 10 years ago

インストールまではエラーがなく完了したんですが、(ここまでは解決しましたありがとうございます)

devモードでログインしてから

上部メニューのマイフォルダをクリックすると

http://ss.initc.mobi/directory/list にURLが変り、

画面側に

symfony PHP Framework ok Symfony Project Created Congratulations! You have successfully created your symfony project.

Project setup successful This project uses the symfony libraries. If you see no image in this page, you may need to configure your web server so that it gains access to the symfony_data/web/sf/ directory. This is a temporary page This page is part of the symfony default module. It will disappear as soon as you define a homepage route in your routing.yml. What's next

Create your data model Customize the layout of the generated templates Learn more from the online documentation

と出るようになってしまいました。フォルダ ?ルートがおかしいかなにかですかね 助言があればお願いします

http://ss.initc.mobi/sf/ にはファイルはあるみたいです。

ghost commented 10 years ago

ファイルをアップすると出るようです。 データにはなにやら入っているみたいです。

mysql> select * from managed_file ;select * from file_directory ; select * from directory_config;

+----+-----------+------------+---------+--------------+---------------------+---------------------+
| id | member_id | name       | file_id | directory_id | created_at          | updated_at          |
+----+-----------+------------+---------+--------------+---------------------+---------------------+
|  1 |         2 | tinpon.jpg |      46 |            1 | 2014-09-30 22:14:55 | 2014-09-30 22:14:55 |
+----+-----------+------------+---------+--------------+---------------------+---------------------+
1 row in set (0.00 sec)

+----+-----------+------+-----------+---------------------+---------------------+
| id | member_id | name | type      | created_at          | updated_at          |
+----+-----------+------+-----------+---------------------+---------------------+
|  1 |         2 | up   | community | 2014-09-30 22:13:21 | 2014-09-30 22:13:21 |
+----+-----------+------+-----------+---------------------+---------------------+
1 row in set (0.00 sec)

+----+--------------+--------------+
| id | directory_id | community_id |
+----+--------------+--------------+
|  1 |            1 |            8 |
+----+--------------+--------------+

1 row in set (0.00 sec)

print_rは

File Object ( 

[roleList:protected] => Array ( ) 

[nestingLevelCheckClasses:protected] => Array ( 

[0] => Album ) 

[nested:protected] => Array ( ) 

[_node:protected] => 

[_id:protected] => Array ( ) 

[_data:protected] => Array ( 

[id] => Doctrine_Null Object ( ) 

[name] => b5206ff321a13eebe55f5e47b0a0aae217af532d_txt 

[type] => application/x-empty 

[filesize] => 0 

[original_filename] => qqqqqqqqqqqqqq.txt 

[created_at] => Doctrine_Null Object ( ) 

[updated_at] => Doctrine_Null Object ( ) ) 

[_values:protected] => Array ( ) 

[_state:protected] => 2 

[_lastModified:protected] => Array ( ) 

[_modified:protected] => Array ( 

[0] => name 

[1] => type 

[2] => filesize 

[3] => type 

[4] => original_filename 

[5] => name ) 

[_oldValues:protected] => Array ( 

plugins/opFileManagePlugin/lib/form/doctrine/PluginManagedFileForm.class.php save メソッドあたりにprint_r($file)

qqqqqqqqqqqqqq.txt をアップすると変数にもはいっているようです。

tail -f /var/log/httpd/error_log の中身は

[Tue Sep 30 22:47:24 2014] [error] [client 58.138.1.209] The "/f/show/:filename" route has some missing mandatory parameters (:filename).
[Tue Sep 30 22:47:34 2014] [error] [client 58.138.1.209] The "/f/show/:filename" route has some missing mandatory parameters (:filename)., referer: http://ss.initc.mobi/community/8

等でます。むずかしいですね・・

amashigeseiji commented 10 years ago

いくつか確認をさせてください。

バージョンについては、いろいろ 0.8.1 -> 0.8.8(いまのところ最新)にする間にたしかかなりいじっているので、できたら最新版にしていただければとおもいます。今日中に 0.9.0 としてリリースしようとおもっていますので、しばらくお待ちください(0.8.8と基本的には変化なしで、マイグレーションスクリプトやらリビジョン指定やらをします。昨日作業していたのですが、なにやら失敗しました)。

それと、プラグイン同梱版の場合、以下については自分で検証していませんのであしからずです。

ghost commented 10 years ago

opSkinThemePlugin をOFFにしたらできました どんぴしゃでした。      :プラグイン ver 8.8.0   :OpenPNE-3.8.12 プラグイン同居版   :opSkinThemePlugin 1.0.1 autumn 2.10

アプリプラグイン

ON  opFileManagePlugin  0.8.8    
ON  opDiaryPlugin   1.4.1   opDiaryPlugin   設定
OFF opLikePlugin    1.2.1   いいね!機能を追加します    
OFF opUploadFilePlugin          
ON  opCommunityTopicPlugin  1.0.5   opCommunityTopicPlugin  設定
ON  opTimelinePlugin    1.2.2   アクティビティをさらに進化させたプラグインです。    設定
ON  opActiveMemberPlugin    0.9.0   ログイン中のメンバーを表示 
ON  opMessagePlugin 1.0.0   opMessagePlugin 

という状態です。

ghost commented 10 years ago

作者様 ありがとうございます。 僭越ですが結構ユーザーが(自分の周りのOPENPNEユーザー not リアル) 同じ形ではまっている人が、いたので、READMEに、注意事項としてopSkinThemePlugin 同居不可能 と書いてあると、うれしくおもう次第であります。いくつかかなりの走り書き程度のコメントすいません。 小生gitの使い方は少ししか分からない上 (READMEの)pull commit は怖いのでしないでおきます。ありがとうございました。

amashigeseiji commented 10 years ago

なるほど。

ふーむ。 一応ローカル環境で検証してみているのですが、機能的には同居不可能ということはなさそうですが…。もっとも、レイアウトは自分が意図したものにはなっていません(スキンテーマが bootstrap で期待されるスタイル定義を上書きしているので)。opSkinThemePlugin もいじっていた時期があるのですが、スタイル定義やjavascript以外のところで干渉しそうなところはなさそうな気がします。 もしも、スキンテーマプラグインが他のプラグインの根本的な機能に対して干渉するとすれば、それはスキンテーマプラグイン側のバグになりそうです(そんなことがあるとすれば割と深刻な気はします)。 いずれにせよ調査しないとわからないですね。

ただ、opUploadPlugin とは機能が類似しているので、もしかすると干渉する可能性があるかもしれません。報告してくださったエラーメッセージが opUploadPlugin のルーティング( f/show/:filename )で、結構気になる内容ですので、こちらはちょっと調査してみようとおもいます。

調査してみて特に問題ないようでしたら、READMEなどもたぶんそのままになるとおもいます。ただ opSkinThemePlugin によってレイアウト崩れ等の可能性がある旨は記述しておいたほうがたしかによいかもしれません。

ちなみに、 ver 0.9.0.1 という形でマイグレーションスクリプトとリビジョン指定したものを先ほどリリースいたしました。仮に今後自分がDB構造の変更など行う場合には、0.9.0.1以下については対応外となりますので、一応可能であればアップデートしていただければという感じです。ただ、0.8.8 とは実質的な違いが全くないのと、今後自分がどれだけこのレポジトリをメンテしていくか微妙なところがあるので、めんどくさいようでしたら特にそのままでも問題は起きないかとはおもいます。

いろいろと詳細な情報ありがとうございます。とりあえず調査内容についてはこの issue に報告しようとおもいます。

amashigeseiji commented 10 years ago

環境合わせてみると現象再現しました。

再現環境としては以下

両プラグインを有効にすると、directory/:id にアクセスしようとするとエラーになります。 もうちょっと調査してみます。

amashigeseiji commented 10 years ago

opUploadFIlePlugin と opFIleManagePlugin のどちらも file_show という名前でルーティングの定義をしているのが原因でした。

$ ag 'file_show'
opFileManagePlugin/apps/pc_frontend/config/routing.yml
2:file_show:

opFileManagePlugin/apps/pc_frontend/modules/file/actions/actions.class.php
80:    $this->redirect($request->getParameter('redirect', '@file_show?id='.$file->getId()));

opFileManagePlugin/apps/pc_frontend/modules/file/templates/_fileListRow.php
3:    <?php echo link_to($file->getName(), 'file_show', $file) ?>

opUploadFilePlugin/apps/pc_frontend/config/routing.yml
1:file_show:

両プラグインでルーティング定義がバッティングしているので発生している問題です(opFIleManagePlugin 側から見ると、ルーティングが上書きされているので意図しない動作になっています)。 ですので、回避方法としては opUploadFilePlugin の無効化ということになりそうです。 READMEを修正するか、それかこの現象をバグとして修正するかしたほうがいいですね。

amashigeseiji commented 10 years ago

とりあえず README を修正しておきました。

ghost commented 10 years ago

迅速な修正ありがとうございます。 ほかに自分用のプライベートフォルダが消せなかったり コミュは正常動作とかそのあたり、まとめたら自分も調査します

amashigeseiji commented 10 years ago

あー、権限関連はバグっぽいですね… 別イシューつくってそこで対応します。

ghost commented 10 years ago

あと ちまたでポップアップがでないという問題は

OPENPNE管理画面 カスタムCSS 

file_upload_form {

margin-top: 0; }

directory_create_form {

margin-top: 0; }

table.table-striped { background: none repeat scroll 0 0 white; }

.thumbnail{ background: none repeat scroll 0 0 white; } にしました。ここは蛇足でしたね 報告までに

ghost commented 10 years ago

あと 変更ボタンを押したあとに何も変更しないで変更すると このページにはアクセスできません。となっていたので報告します

ghost commented 10 years ago

○該当箇所?    /**

上記の形でしのいでいます。報告します。

amashigeseiji commented 10 years ago

ご報告ありがとうございます。

あと 変更ボタンを押したあとに何も変更しないで変更すると このページにはアクセスできません。なったので報告します

なるほど。先の権限の問題と合わせて、リリースします。

ちまたでポップアップがでないという問題

これは公式SNSの→ http://sns.openpne.jp/communityTopic/256 ですかね? これ調査してみたのですが、どうにも再現しません。確実な再現条件がわからないと修正が妥当かどうかの判断もつかないので、ちょっと放置します。再現条件がわかれば対応します。

amashigeseiji commented 10 years ago

権限周りの問題と、ファイル名およびフォルダ名が空欄のまま編集ボタンを押下した時の挙動の変更について対応したものを、0.9.1でリリースしました。

ghost commented 10 years ago

そうです 書き込みは私です。 ファイル名のやつpushしようとおもったんですが 対応してもらったんですね。ありがとうございます。

またなんか見つけたら質問かpushしますね。 再現はちょっとまってください。書きます

ghost commented 10 years ago

プラグイン同梱版OpenPNE3.8.13 http://www.openpne.jp/archives/12578/ opSkinThemePlugin 1.0.11 スキンテーマ管理プラグイン

プラグイン同梱版なので対応はしなくてもいいかなぁと思います 方針は私はきめられないですけど

ちなみにダイアログの margin-top: 0; が ダイアログ表示時 margin-top: -255;となって 画面外にでる現象です。

以上 修正  ありがとうございました。

ghost commented 10 years ago

もうひとつ報告です。

上記環境で プラグインをONにすると  トップ画面 ログインできない方はこちら → ログインしないと見れません          新規登録→ログインしないと見れません

と表示されます。

ghost commented 10 years ago

原因がこれか分かりませんが

OpenPNE3/plugins/opFileManagePlugin/apps/pc_frontend/config/security.yml  これの true falseが影響してるみたいです。

ghost commented 10 years ago

となると  OpenPNE3/plugins/opFileManagePlugin/apps/pc_frontend/config/security.ymlをコメントアウト

OpenPNE3/plugins/opFileManagePlugin/apps/pc_frontend/modules/* /config/

にsecurity.ymlを個別に設置してしのぎました!

報告です。

amashigeseiji commented 10 years ago

security.yml 配置する場所間違ってますね(各module配下に置くのが正しいです)。ありがとうございます。 修正方針も妥当なので、そのまま取り入れようかとおもいます。

amashigeseiji commented 10 years ago

ログイン不要なページでログイン要求される問題に対応したものを、 0.9.2 でリリースしました。 http://plugins.openpne.jp/release/559