Implem / Implem.Pleasanter

Pleasanter is a no-code/low-code development platform that runs on .NET. You can quickly create business applications with simple operations.
https://pleasanter.org
GNU Affero General Public License v3.0
530 stars 84 forks source link

バージョン1.4.6.x以上への更新を実施後、サーバーエラーが発生しページが表示できなくなる #564

Closed fr-sudachi closed 3 weeks ago

fr-sudachi commented 3 weeks ago

概要

バージョン1.4.5.0以前から1.4.6.0移行へ更新を行うと、ブラウザでアクセスした際にサーバエラーが発生する現象を確認しました。
元々は1.3.31.0からの最新バージョンへの更新を予定しておりましたが、本問題が発生したため、段階的に更新予定バージョンを下げて、検証を行いました。
1.4.5.0への更新は問題ないことを確認しております。

環境

Dockerコンテナでの実行で確認いたしました。
RDBMSはPostgreSQLの16を使用しています。こちらもDockerコンテナです。
元バージョンは1.3.31.0です。

アプリバージョンの更新手順

ユーザマニュアルの「バージョンアップ・更新」を参考に、Dockerコンテナ用に下記を行っています。

Paramertersの変更

バージョン1.4.7.2をローカルにダウンロードし、変更箇所のマージを行ったものを、/app/Implem.Pleasanter/App_Data/Parametersへボリュームマウントします。 アプリ側とCodeDefiner側両方にマウントしています。

Dockerコンテナのセットアップ

  1. DockerHubの説明に記載の通り、.envdocker-compose.ymlを作成。
  2. Paramertersのボリュームマウント設定を追記

アプリケーションの起動

  1. docker compose run codedefiner _rdsを実行
  2. 成功したら、docker compose up -d -p 8080:8080 pleasanrerを実行

現象の再現手順

  1. ブラウザで、localhost:8080を開く。

現象発生時のログ

info: Microsoft.Hosting.Lifetime[14]
      Now listening on: http://[::]:8080
info: Microsoft.Hosting.Lifetime[0]
      Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
      Hosting environment: Production
info: Microsoft.Hosting.Lifetime[0]
      Content root path: /app
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/1.1 GET http://localhost:8080/errors - - -
fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[1]
      An unhandled exception has occurred while executing the request.
      Npgsql.PostgresException (0x80004005): 42703: column Tenants.Language does not exist

      POSITION: 439
         at Npgsql.Internal.NpgsqlConnector.ReadMessageLong(Boolean async, DataRowLoadingMode dataRowLoadingMode, Boolean readingNotifications, Boolean isReadingPrependedMessage)
         at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token)
         at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming, CancellationToken cancellationToken)
         at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming, CancellationToken cancellationToken)
         at Npgsql.NpgsqlDataReader.NextResult()
         at Npgsql.NpgsqlCommand.ExecuteReader(Boolean async, CommandBehavior behavior, CancellationToken cancellationToken)
         at Npgsql.NpgsqlCommand.ExecuteReader(Boolean async, CommandBehavior behavior, CancellationToken cancellationToken)
         at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior behavior)
         at Npgsql.NpgsqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
         at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
         at System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
         at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
         at Implem.PostgreSql.PostgreSqlDataAdapter.Fill(DataTable dataTable) in /src/Rds/Implem.PostgreSql/PostgreSqlDataAdapter.cs:line 104
         at Implem.Libraries.DataSources.SqlServer.SqlIo.<>c__DisplayClass15_0.<ExecuteTable>b__0() in /src/Implem.Libraries/DataSources/SqlServer/SqlIo.cs:line 175
         at Implem.Libraries.DataSources.SqlServer.SqlIo.Try(ISqlObjectFactory factory, Action action) in /src/Implem.Libraries/DataSources/SqlServer/SqlIo.cs:line 287
         at Implem.Libraries.DataSources.SqlServer.SqlIo.ExecuteTable(ISqlObjectFactory factory, IDbTransaction dbTransaction, IDbConnection dbConnection) in /src/Implem.Libraries/DataSources/SqlServer/SqlIo.cs:line 172
         at Implem.Pleasanter.Libraries.DataSources.Rds.ExecuteTable(Context context, IDbTransaction dbTransaction, IDbConnection dbConnection, String connectionString, Boolean transactional, Boolean writeSqlToDebugLog, SqlStatement[] statements) in /src/Implem.Pleasanter/Libraries/DataSources/Rds.cs:line 287
         at Implem.Pleasanter.Libraries.DataSources.Repository.<>c__DisplayClass10_0.<ExecuteTable>b__0(IDbTransaction transaction, IDbConnection connection) in /src/Implem.Pleasanter/Libraries/DataSources/Repository.cs:line 321
         at Implem.Pleasanter.Libraries.DataSources.Rds.ExecuteScalar[T](Context context, String connectionString, Boolean transactional, Func`3 func) in /src/Implem.Pleasanter/Libraries/DataSources/Rds.cs:line 238
         at Implem.Pleasanter.Libraries.DataSources.Repository.ExecuteTable(Context context, String connectionString, Boolean transactional, SqlStatement[] statements) in /src/Implem.Pleasanter/Libraries/DataSources/Repository.cs:line 315
         at Implem.Pleasanter.Models.TenantModel.Get(Context context, SiteSettings ss, TableTypes tableType, SqlColumnCollection column, SqlJoinCollection join, SqlWhereCollection where, SqlOrderByCollection orderBy, SqlParamCollection param, Boolean distinct, Int32 top) in /src/Implem.Pleasanter/Models/Tenants/TenantModel.cs:line 461
         at Implem.Pleasanter.Models.TenantModel..ctor(Context context, SiteSettings ss, Int32 tenantId, Dictionary`2 formData, TenantApiModel tenantApiModel, SqlColumnCollection column, Boolean clearSessions, List`1 switchTargets, MethodTypes methodType) in /src/Implem.Pleasanter/Models/Tenants/TenantModel.cs:line 382
         at Implem.Pleasanter.Libraries.Initializers.TenantInitializer.Initialize() in /src/Implem.Pleasanter/Libraries/Initializers/TenantInitializer.cs:line 22
         at Implem.Pleasanter.NetCore.Startup.Initialize() in /src/Implem.Pleasanter/Startup.cs:line 435
         at Implem.Pleasanter.NetCore.Startup.Invoke(HttpContext httpContext, Func`1 next) in /src/Implem.Pleasanter/Startup.cs:line 396
         at Implem.Pleasanter.NetCore.Startup.<Configure>b__4_0(HttpContext context, Func`1 next) in /src/Implem.Pleasanter/Startup.cs:line 256
         at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddlewareImpl.<Invoke>g__Awaited|10_0(ExceptionHandlerMiddlewareImpl middleware, HttpContext context, Task task)
        Exception data:
          Severity: ERROR
          SqlState: 42703
          MessageText: column Tenants.Language does not exist
          Position: 439
          File: parse_relation.c
          Line: 3713
          Routine: errorMissingColumn
nozoe commented 3 weeks ago

1.4.6以降 CodeDefinerのパラメータが増えていますが、その辺は大丈夫ですか?

https://pleasanter.org/ja/manual/getting-started-pleasanter-windows

fr-sudachi commented 3 weeks ago

1.4.6以降 CodeDefinerのパラメータが増えていますが、その辺は大丈夫ですか?

ありがとうございます。
Pleasanter停止→下記を実行→Pleasaner起動を試してみましたが、解消されませんでした。

docker compose run codedefiner _rds /l ja /z "Tokyo Standard Time"
docker compose run --rm codedefiner _rds /l ja /z "Asia/Tokyo"
nagamune-implem commented 3 weeks ago

Issueありがとうございます。

頂いたエラーメッセージを見ると[Tenants]テーブルの[Language]カラムの生成が出来ていないようです、 考えられる原因としまして「CodeDefiner _rds」が正しく実行出来ていない事が考えられます。

CodeDefinerに下記パラメータを追加して、[Tenants]テーブルに[Language]カラムがある事をご確認頂ければと思います。

codedefiner _rds /p 【Docker内のプリザンターの格納フォルダ】

※)細かいパラメータの指定の部分は適宜読み替えて頂ければと思います。

以上、よろしくお願いいたします。

fr-sudachi commented 3 weeks ago

CodeDefinerコンテナ内のパスでしょうか。
/app/Implem.Pleasanterがデフォルトのパスと認識しており、App_Data/Parameters配下のファイルを編集しています。
(実際にはホスト側のParametersフォルダをここへマウントしています。)

codedefinerにオプションpを付与して実行してみました。
先頭文字列がスラッシュだとパラメータを読み取ってくれないようで、パス区切り文字をバックスラッシュで指定しています。

docker compose run --rm codedefiner _rds /p "\app\Implem.Pleasanter" /l "ja" /z "Asia/Tokyo"
[+] Creating 1/0
 ✔ Container pleasanter-db  Running 
<INFO> RdsConfigurator.UpdateDatabase: Implem.Pleasanter
<INFO> UsersConfigurator.Execute: Implem.Pleasanter_Owner
<INFO> UsersConfigurator.Execute: Implem.Pleasanter_User
<INFO> SchemaConfigurator.Configure: public
<INFO> TablesConfigurator.ConfigureTableSet: AutoNumberings
<INFO> TablesConfigurator.ConfigureTableSet: Binaries
<INFO> TablesConfigurator.ConfigureTableSet: Demos
<INFO> TablesConfigurator.ConfigureTableSet: Depts
<INFO> TablesConfigurator.ConfigureTableSet: ExportSettings
<INFO> TablesConfigurator.ConfigureTableSet: Extensions
<INFO> TablesConfigurator.ConfigureTableSet: GroupMembers
<INFO> TablesConfigurator.ConfigureTableSet: Groups
<INFO> TablesConfigurator.ConfigureTableSet: Items
<INFO> TablesConfigurator.ConfigureTableSet: Links
<INFO> TablesConfigurator.ConfigureTableSet: LoginKeys
<INFO> TablesConfigurator.ConfigureTableSet: MailAddresses
<INFO> TablesConfigurator.ConfigureTableSet: Orders
<INFO> TablesConfigurator.ConfigureTableSet: OutgoingMails
<INFO> TablesConfigurator.ConfigureTableSet: Registrations
<INFO> TablesConfigurator.ConfigureTableSet: ReminderSchedules
<INFO> TablesConfigurator.ConfigureTableSet: Sessions
<INFO> TablesConfigurator.ConfigureTableSet: Sites
<INFO> TablesConfigurator.ConfigureTableSet: Statuses
<INFO> TablesConfigurator.ConfigureTableSet: SysLogs
<INFO> TablesConfigurator.ConfigureTableSet: Tenants
<INFO> TablesConfigurator.ConfigureTableSet: Users
<INFO> TablesConfigurator.ConfigureTableSet: Permissions
<INFO> TablesConfigurator.ConfigureTableSet: Dashboards
<INFO> TablesConfigurator.ConfigureTableSet: Issues
<INFO> TablesConfigurator.ConfigureTableSet: Results
<INFO> TablesConfigurator.ConfigureTableSet: Wikis
<INFO> PrivilegeConfigurator.Execute: Implem.Pleasanter_Owner
<INFO> PrivilegeConfigurator.Execute: Implem.Pleasanter_User
<SUCCESS> Starter.ConfigureDatabase: Database configuration has been completed.
<SUCCESS> Starter.Main: All of the processes have been completed.

これを実施後も問題は解消されませんでした。

nagamune-implem commented 3 weeks ago

@fr-sudachi 確認ありがとうございます。 これで動くとの確約はできませんが、下記を試して頂けますでしょうか?

codedefinerのdocker imageを更新

docker pull implem/pleasanter:codedefiner

その後に再度「codedefiner _rds」を実行

下記のメッセージが画面に出ていればOKです。

<INFO> RdsConfigurator.UpdateDatabase: Implem.Pleasanter
<INFO> UsersConfigurator.Execute: Implem.Pleasanter_Owner
<INFO> UsersConfigurator.Execute: Implem.Pleasanter_User
<INFO> SchemaConfigurator.Configure:
<INFO> TablesConfigurator.ConfigureTableSet: AutoNumberings
<INFO> TablesConfigurator.ConfigureTableSet: Binaries
【略】
<INFO> TablesConfigurator.ConfigureTableSet: Tenants
<INFO> Tables.MigrateTable: Tenants ★この行でTenantsテーブルの更新が確認できる
<INFO> Tables.CreateTable: Tenants
<INFO> TablesConfigurator.ConfigureTableSet: Users
【略】
<INFO> PrivilegeConfigurator.Execute: Implem.Pleasanter_Owner
<INFO> PrivilegeConfigurator.Execute: Implem.Pleasanter_User
<SUCCESS> Starter.ConfigureDatabase: Database configuration has been completed.
<SUCCESS> Starter.Main: All of the processes have been completed.

あとは、「codedefinerが参照しているパラメータが本当にマウントしたフォルダ内の物なのか?」等が確認ポイントになるかと思います。

fr-sudachi commented 3 weeks ago

これで動くとの確約はできませんが、下記を試して頂けますでしょうか?

codedefinerのdocker imageを更新

docker pull implem/pleasanter:codedefiner

こちらで解決いたしました。
私の知識不足で申し訳ないです。
同名のイメージの場合は、レジストリ上の更新を自動で取得してくれないのですね。
今後更新作業を行う際は、イメージを明示的にpullすることにいたします。

ご教授頂きありがとうございました。

nagamune-implem commented 3 weeks ago

@fr-sudachi プリザンターのバージョンアップがうまく行ったようで良かったです。 問題が解消したようでしたら、本チケットのCloseして頂ければと思います。

以上、よろしくお願いいたします。