Hallo zusammen,
ich bin schon recht weit gekommen, openpetra in folgendem docker-compose setup...
- openpetra + nginx
- phpmyadmin
- mariadb
- draußen herum traefik reverse proxy
... zum Laufen zu bekommen.
Im Grunde nutze ich getopenpetra.sh (mit ein Paar Anpassungen um systemd aus dem Weg zu gehen).
cat Dockerfile
FROM debian:10
RUN apt-get update && apt-get install -y curl wget vim net-tools netcat cron
RUN mkdir -p /home/openpetra && cd /home/openpetra && \
curl -o getopenpetra.sh https://getopenpetra.com && \
sed -i 's/systemctl/#systemctl/g' getopenpetra.sh && \
sed -i '/initdb/d' getopenpetra.sh && \
bash getopenpetra.sh test
ADD run.sh /run.sh
CMD [ "/run.sh" ]
cat run.sh
#!/bin/bash
# init home of $OP_CUSTOMER
useradd -s /bin/bash -m -d /home/${OP_CUSTOMER} ${OP_CUSTOMER}
chown -R ${OP_CUSTOMER}:openpetra /home/${OP_CUSTOMER}
/home/openpetra/openpetra-server.sh init
# init database
## only execute this at first run!
## make sure /home/${OP_CUSTOMER}/etc/PetraServerConsole.config is filled with database config
# /home/openpetra/openpetra-server.sh initdb
# start nginx
/usr/sbin/nginx
# start server for $OP_CUSTOMER
su ${OP_CUSTOMER} bash -c "/home/openpetra/openpetra-server.sh start"
Außerdem habe ich eine angepasste /home/${OP_CUSTOMER}/etc/PetraServerConsole.config mit Verweis auf den mysql container.
initdb schlägt nun Fehl mit folgender Meldung:
/home/openpetra/openpetra-server.sh initdb
cat: /usr/lib/systemd/system/openpetra.service: No such file or directory
preparing OpenPetra database...
creating tables...
ERROR 1050 (42S01) at line 5: Table 's_user' already exists
initial data...
ERROR 1062 (23000) at line 1: Duplicate entry 'SYSADMIN' for key 'PRIMARY'
loading database from /home/openpetra/db/clean.yml.gz with config /home/${OP_CUSTOMER}/etc/PetraServerConsole.config
13:55:43 Running InitThread for thread id 1
13:55:43 FindSessionID: Session ID not found in the HttpContext
13:55:43 Waiting to obtain Thread-safe access to the Database Abstraction Layer... (Call performed in Thread 1 in AppDomain 'Ict.Petra.Tools.MSysMan.YmlGzImportExport.exe')
13:55:43 Obtained Thread-safe access to the Database Abstraction Layer... (Call performed in Thread 1 in AppDomain 'Ict.Petra.Tools.MSysMan.YmlGzImportExport.exe')
13:55:43 number of database connections 1
13:55:43 Connecting to database MySQL SessionInitThread (Conn.Identifier: 26b1c340-eccc-46d5-9e79-6c68a494e495) (Connection Name: SessionInitThread): SERVER=db;DATABASE=openpetra;Convert Zero Datetime=True;UID=openpetra;PASSWORD=*hidden* (Call performed in Thread 1 in AppDomain 'Ict.Petra.Tools.MSysMan.YmlGzImportExport.exe')
13:55:43 Released Thread-safe access to the Database Abstraction Layer. (Call performed in Thread 1 in AppDomain 'Ict.Petra.Tools.MSysMan.YmlGzImportExport.exe')...
13:55:43 Begin Transaction WriteTransaction in Connection SessionInitThread with level Serializable
13:55:43 TSession: Creating new session: 120281db-f88a-4c46-8c1e-7164b3e39b36
13:55:43 Waiting to obtain Thread-safe access to the Database Abstraction Layer... (Call performed in Thread 1 in AppDomain 'Ict.Petra.Tools.MSysMan.YmlGzImportExport.exe')
13:55:43 Obtained Thread-safe access to the Database Abstraction Layer... (Call performed in Thread 1 in AppDomain 'Ict.Petra.Tools.MSysMan.YmlGzImportExport.exe')
13:55:43 (Context: 'Ict.Common.DB.TDataBase.ExecuteNonQuery()')
The SQL query is:
DELETE
FROM PUB_s_session
WHERE s_valid_until_d < NOW()
13:55:43 Entering Ict.Common.DB.TDataBase.Command()...
13:55:43 Ict.Common.DB.TDataBase.Command: now getting DbCommand(DELETE FROM PUB_s_session WHERE s_valid_until_d < NOW())...
13:55:43 Query formatted for MySQL: DELETE FROM s_session WHERE s_valid_until_d < NOW()
13:55:43 Number of rows affected: 0
13:55:43 Released Thread-safe access to the Database Abstraction Layer. (Call performed in Thread 1 in AppDomain 'Ict.Petra.Tools.MSysMan.YmlGzImportExport.exe')...
13:55:43 Waiting to obtain Thread-safe access to the Database Abstraction Layer... (Call performed in Thread 1 in AppDomain 'Ict.Petra.Tools.MSysMan.YmlGzImportExport.exe')
13:55:43 Obtained Thread-safe access to the Database Abstraction Layer... (Call performed in Thread 1 in AppDomain 'Ict.Petra.Tools.MSysMan.YmlGzImportExport.exe')
13:55:43 (Context: 'Ict.Common.DB.TDataBase.ExecuteScalar()')
The SQL query is:
SELECT COUNT(*)
FROM PUB_s_session
WHERE s_session_id_c = ?
13:55:43 Parameter: 1 120281db-f88a-4c46-8c1e-7164b3e39b36 System.String VarChar 36
13:55:43 Ict.Common.DB.TDataBase.ExecuteScalar: now creating Command(SELECT COUNT(*) FROM PUB_s_session WHERE s_session_id_c = ?)...
13:55:43 Entering Ict.Common.DB.TDataBase.Command()...
13:55:43 Ict.Common.DB.TDataBase.Command: now getting DbCommand(SELECT COUNT(*) FROM PUB_s_session WHERE s_session_id_c = ?)...
13:55:43 Query formatted for MySQL: SELECT COUNT(*) FROM s_session WHERE s_session_id_c = ?
13:55:43 Ict.Common.DB.TDataBase.ExecuteScalar: now calling Command.ExecuteScalar...
13:55:43 Ict.Common.DB.TDataBase.ExecuteScalar: finished calling Command.ExecuteScalar
13:55:43 Result from ExecuteScalar is 0 System.Int64
13:55:43 Released Thread-safe access to the Database Abstraction Layer. (Call performed in Thread 1 in AppDomain 'Ict.Petra.Tools.MSysMan.YmlGzImportExport.exe')...
13:55:43 Waiting to obtain Thread-safe access to the Database Abstraction Layer... (Call performed in Thread 1 in AppDomain 'Ict.Petra.Tools.MSysMan.YmlGzImportExport.exe')
13:55:43 Obtained Thread-safe access to the Database Abstraction Layer... (Call performed in Thread 1 in AppDomain 'Ict.Petra.Tools.MSysMan.YmlGzImportExport.exe')
13:55:43 (Context: 'Ict.Common.DB.TDataBase.ExecuteNonQuery()')
The SQL query is:
INSERT INTO PUB_s_session (s_session_values_c, s_session_id_c, s_valid_until_d) VALUES (?,?,?)
13:55:43 Parameter: 1 {} System.String Text 2
13:55:43 Parameter: 2 120281db-f88a-4c46-8c1e-7164b3e39b36 System.String VarChar 36
13:55:43 Parameter: 3 01/09/2020 13:55:43 System.DateTime DateTime 0
13:55:43 Entering Ict.Common.DB.TDataBase.Command()...
13:55:43 Ict.Common.DB.TDataBase.Command: now getting DbCommand(INSERT INTO PUB_s_session (s_session_values_c, s_session_id_c, s_valid_until_d) VALUES (?,?,?))...
13:55:43 Query formatted for MySQL: INSERT INTO s_session (s_session_values_c, s_session_id_c, s_valid_until_d) VALUES (?,?,?)
13:55:43 Number of rows affected: 1
13:55:43 Released Thread-safe access to the Database Abstraction Layer. (Call performed in Thread 1 in AppDomain 'Ict.Petra.Tools.MSysMan.YmlGzImportExport.exe')...
13:55:43 Transaction WriteTransaction in Connection SessionInitThread committed
13:55:43 Waiting to obtain Thread-safe access to the Database Abstraction Layer... (Call performed in Thread 1 in AppDomain 'Ict.Petra.Tools.MSysMan.YmlGzImportExport.exe')
13:55:43 Obtained Thread-safe access to the Database Abstraction Layer... (Call performed in Thread 1 in AppDomain 'Ict.Petra.Tools.MSysMan.YmlGzImportExport.exe')
13:55:43 Released Thread-safe access to the Database Abstraction Layer. (Call performed in Thread 1 in AppDomain 'Ict.Petra.Tools.MSysMan.YmlGzImportExport.exe')...
13:55:43 DB Transaction (Trans.Identifier: 327544e7-b473-41f7-b493-1218d90ec600) (Transaction Name: WriteTransaction) got rolled back. Before that, its DB Transaction Properties were: Valid: True, IsolationLevel: Serializable (it got started on Thread System.Threading.Thread in AppDomain 'Ict.Petra.Tools.MSysMan.YmlGzImportExport.exe').
13:55:43 Waiting to obtain Thread-safe access to the Database Abstraction Layer... (Call performed in Thread 1 in AppDomain 'Ict.Petra.Tools.MSysMan.YmlGzImportExport.exe')
13:55:43 Obtained Thread-safe access to the Database Abstraction Layer... (Call performed in Thread 1 in AppDomain 'Ict.Petra.Tools.MSysMan.YmlGzImportExport.exe')
13:55:43 Closing Database connection... (Conn.Identifier: 26b1c340-eccc-46d5-9e79-6c68a494e495) (Connection Name: SessionInitThread)
13:55:43 TDataBase.CloseDBConnectionInternal: (Conn.Identifier: 26b1c340-eccc-46d5-9e79-6c68a494e495) (Connection Name: SessionInitThread) before calling FDBConnectionInstance.CloseODBCConnection(FConnection) in AppDomain 'Ict.Petra.Tools.MSysMan.YmlGzImportExport.exe'
TLogWriter:Log was not able to write to the log file. msg: TDataBase.CloseDBConnectionInternal: (Conn.Identifier: 26b1c340-eccc-46d5-9e79-6c68a494e495) (Connection Name: SessionInitThread) before calling FDBConnectionInstance.CloseODBCConnection(FConnection) in AppDomain 'Ict.Petra.Tools.MSysMan.YmlGzImportExport.exe'
System.ArgumentException: Empty path name is not legal.
at System.IO.StreamWriter..ctor (System.String path, System.Boolean append, System.Text.Encoding encoding, System.Int32 bufferSize, System.Boolean checkHost) [0x0003e] in <d0e12f672b88444ab4b6d9b2ecf20142>:0
at System.IO.StreamWriter..ctor (System.String path, System.Boolean append, System.Text.Encoding encoding, System.Int32 bufferSize) [0x00000] in <d0e12f672b88444ab4b6d9b2ecf20142>:0
at System.IO.StreamWriter..ctor (System.String path, System.Boolean append) [0x00008] in <d0e12f672b88444ab4b6d9b2ecf20142>:0
at (wrapper remoting-invoke-with-check) System.IO.StreamWriter..ctor(string,bool)
at System.IO.File.AppendAllText (System.String path, System.String contents) [0x00000] in <d0e12f672b88444ab4b6d9b2ecf20142>:0
at Ict.Common.TLogWriter.Log (System.String strFile, System.String strMessage) [0x00127] in <d7679a5332214acbb276fa24a36da2f5>:0
Unhandled Exception:
Ict.Common.ENoLoggingToFile_WrongConstructorUsedException: Exception of type 'Ict.Common.ENoLoggingToFile_WrongConstructorUsedException' was thrown.
at Ict.Common.TLogging.Log (System.String Text, Ict.Common.TLoggingType ALoggingType, Ict.Common.TLogging+TStatusCallbackProcedure ACustomStatusCallbackProcedure) [0x0021e] in <d7679a5332214acbb276fa24a36da2f5>:0
at Ict.Common.DB.TDataBase.CloseDBConnectionInternal (System.Boolean ASuppressThreadCompatibilityCheck) [0x0016c] in <6d939accbca64f6d9a704e907d217e23>:0
at Ict.Common.DB.TDataBase.CloseDBConnection (System.Boolean ASuppressThreadCompatibilityCheck) [0x00021] in <6d939accbca64f6d9a704e907d217e23>:0
at Ict.Common.Session.TSession.InitThread (System.String ASessionID) [0x00092] in <e5e2f192c90a49939f0f34aa58ac0868>:0
at Ict.Petra.Tools.MSysMan.YmlGzImportExport.TYmlGzImportExport.Main (System.String[] args) [0x0006c] in <a089e5e4b08249658eb3fa64a72a60e3>:0
13:55:43 Released Thread-safe access to the Database Abstraction Layer. (Call performed in Thread 1 in AppDomain 'Ict.Petra.Tools.MSysMan.YmlGzImportExport.exe')...
[ERROR] FATAL UNHANDLED EXCEPTION: Ict.Common.ENoLoggingToFile_WrongConstructorUsedException: Exception of type 'Ict.Common.ENoLoggingToFile_WrongConstructorUsedException' was thrown.
at Ict.Common.TLogging.Log (System.String Text, Ict.Common.TLoggingType ALoggingType, Ict.Common.TLogging+TStatusCallbackProcedure ACustomStatusCallbackProcedure) [0x0021e] in <d7679a5332214acbb276fa24a36da2f5>:0
at Ict.Common.DB.TDataBase.CloseDBConnectionInternal (System.Boolean ASuppressThreadCompatibilityCheck) [0x0016c] in <6d939accbca64f6d9a704e907d217e23>:0
at Ict.Common.DB.TDataBase.CloseDBConnection (System.Boolean ASuppressThreadCompatibilityCheck) [0x00021] in <6d939accbca64f6d9a704e907d217e23>:0
at Ict.Common.Session.TSession.InitThread (System.String ASessionID) [0x00092] in <e5e2f192c90a49939f0f34aa58ac0868>:0
at Ict.Petra.Tools.MSysMan.YmlGzImportExport.TYmlGzImportExport.Main (System.String[] args) [0x0006c] in <a089e5e4b08249658eb3fa64a72a60e3>:0
Im browser lädt eine openpetra Seite, jedoch hat diese nur den Inhalt:
"icon" Loading...
Hat jemand einen Tipp, was noch falsch läuft.
Grüße,
yeoldegrove