seq-tickets icon indicating copy to clipboard operation
seq-tickets copied to clipboard

Docker shell handles spaces in arguments incorrectly

Open steven-tribu opened this issue 4 years ago • 3 comments

Describe the bug Docker shell fails handling arguments that contain spaces (quoted or escaped) preventing metastore migration from working.

To Reproduce Steps to reproduce the behavior:

  1. docker run -e ACCEPT_EULA=Y -v $SEQ_DATA:/data datalust/seq shell
  2. seqsvr metastore to-mssql -c Server=my.database.server;Initial\ Catalog=seq;Persist\ Security\ Info=False;User\ ID=user;Password=password;MultipleActiveResultSets=False;Encrypt=True;TrustSe rverCertificate=False;Connection\ Timeout=30;
  3. seqsvr metastore to-mssql -c 'Server=my.database.server;Initial Catalog=seq;Persist Security Info=False;User ID=user;Password=password;MultipleActiveResultSets=False;Encrypt=True;TrustSe rverCertificate=False;Connection Timeout=30;'

Expected behavior Metastore is successfully migrated to MSSQL/PGSQL server.

Actual behaviour Without quotes wrapped around parameter:

[06:45:41 INF] Moving the internal metastore to Microsoft SQL Server/Azure SQL
[06:45:42 WRN] SQL Server metastore connection failed; retrying
Microsoft.Data.SqlClient.SqlException (0x80131904): Login failed for user ''.
   at Microsoft.Data.ProviderBase.DbConnectionPool.CheckPoolBlockingPeriod(Exception e)
   at Microsoft.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
   at Microsoft.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
   at Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
   at Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
   at Microsoft.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
   at Microsoft.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
   at Microsoft.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
   at Microsoft.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
   at Microsoft.Data.SqlClient.SqlConnection.Open()
   at Quince.Storage.MSSql.Schema.SchemaUp.Apply(String connectionString, String schema)
ClientConnectionId:d8b3c0e9-09d5-4964-b7d1-351418925e52
Error Number:18456,State:1,Class:14

With quotes wrapped around parameter:

Error: Unrecognized options: Catalog=seq;Persist, Security, Info=False;User, ID=user;Password=password;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection, Timeout=30;

Environment (please complete the following information):

  • OS: Windows
  • Browser: Firefox
  • Seq Version: 2021.3.6681
  • Using Docker? Yes

Additional context Have migrated the metastore manually by dumping pairs via lmdb-cli and writing insert scripts so no immediate need for a fix from my end.

The metastore command itself seems to work correctly when run in Windows however as lmdb isn't supported on that platform it's not viable from a data migration standpoint.

steven-tribu avatar Nov 29 '21 04:11 steven-tribu

Thanks for the report! We're planning to get bash out of the container entrypoint, to avoid these kinds of escaping issues :+1:

nblumhardt avatar Nov 30 '21 03:11 nblumhardt

Our plan for this:

  • Have the Seq executable itself run init scripts
  • Have Seq receive its storage path via an environment variable
  • Bake the /data storage path into the container's environment at build time
  • Ensure all other Seq defaults make sense without any wrapper script, and
  • Make the Seq executable the entry point of the container

nblumhardt avatar Sep 08 '22 05:09 nblumhardt

Unfortunately this hasn't made it into 2023.4, but we're still aiming to solve this as soon as possible.

nblumhardt avatar Aug 24 '23 23:08 nblumhardt