Defect #30285

Microsoft SQL server support is broken

Added by Go MAEDA over 1 year ago. Updated 6 days ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Go MAEDA% Done:

0%

Category:Database
Target version:4.0.7
Resolution:Fixed Affected version:

Description

Redmine 4.0.0 does not work with Microsoft SQL Server.

One of the causes is that a dependent library activerecord-sqlserver-adapter does not support Rails 5.2 yet.

https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/issues/636

sqlserver.patch Magnifier (4.55 KB) Pavel Rosický, 2019-06-11 21:34

patchCygwin.jpg (399 KB) Hiep Le, 2019-07-16 10:56

Gemfile.patch Magnifier - update gems for sql server support (786 Bytes) Pavel Rosický, 2020-03-31 16:37


Related issues

Related to Redmine - Defect #30284: Internal Server Error When Deleting a User Closed
Related to Redmine - Defect #30211: Crash with the message "undefined method `alias_method_ch... Closed
Related to Redmine - Defect #30210: Application crash when deleting an issue from issue list ... Closed
Related to Redmine - Feature #23630: Migrate to Rails 5.2 Closed
Related to Redmine - Defect #28506: Error Setup Redmine with Win10 Closed
Related to Redmine - Patch #31230: Fix: migration fails in MS SQL-Server Closed

Associated revisions

Revision 19628
Added by Go MAEDA 6 days ago

Update tiny_tds to 1.0.5 and activecord-sqlserver-adapter to 5.2.1 (#30285).

Patch by Pavel Rosický.

Revision 19629
Added by Go MAEDA 6 days ago

Merged r19628 from trunk to 4.1-stable (#30285).

Revision 19630
Added by Go MAEDA 6 days ago

Merged r19628 from trunk to 4.0-stable (#30285).

History

#1 Updated by Go MAEDA over 1 year ago

  • Related to Defect #30284: Internal Server Error When Deleting a User added

#2 Updated by Go MAEDA over 1 year ago

  • Related to Defect #30211: Crash with the message "undefined method `alias_method_chain'" when connecting to Microsoft SQL Server added

#3 Updated by Go MAEDA over 1 year ago

  • Related to Defect #30210: Application crash when deleting an issue from issue list with SQLServer added

#4 Updated by Go MAEDA over 1 year ago

#5 Updated by Go MAEDA over 1 year ago

  • Subject changed from Microsoft SQL server is broken to Microsoft SQL server support is broken

#6 Updated by Jean-Philippe Lang about 1 year ago

  • Target version changed from 4.0.1 to 4.0.2

#7 Updated by Go MAEDA about 1 year ago

activerecord-sqlserver-adapter 5.2.0.rc1 has been released on February 12.

#8 Updated by Jean-Philippe Lang about 1 year ago

  • Target version changed from 4.0.2 to Candidate for next minor release

Waiting for final release of activerecord-sqlserver-adapter 5.2.0

#9 Updated by Marius BALTEANU about 1 year ago

#10 Updated by Marius BALTEANU about 1 year ago

  • Related to deleted (Defect #28506: Error Setup Redmine with Win10)

#11 Updated by Marius BALTEANU about 1 year ago

#12 Updated by Go MAEDA about 1 year ago

activerecord-sqlserver-adapter 5.2.0 has been released on March 19.
https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/blob/master/CHANGELOG.md#v520

Can anyone test if Redmine 4.0 works with MS SQL Server? Please note that you have to run bundle update to install the latest activerecord-sqlserver-adapter gem.

#13 Updated by sebastián scarano about 1 year ago

yeap, here's the release, it would be great if redmine latest version could be confirmed to work ok with sql server...

and update the note at http://www.redmine.org/projects/redmine/wiki/RedmineInstall#Supported-database-back-ends

Redmine 4.0 does not support SQL Server as of December 2018 because a dependent library activerecord-sqlserver-adapter does not support Rails 5.2 yet.

#14 Updated by Pavel Rosický about 1 year ago

I tested it on SQL Server 2017 with these gems
activerecord-sqlserver-adapter (5.2.0)
tiny_tds (2.1.2-x64-mingw32)

it passes all tests, but unfortunatelly there's a problem with migrations due to this bug
https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/691

TinyTds::Error: The object 'DF_projects_description' is dependent on column 'description'.
087_change_projects_description_to_text.rb:5:in `up'

there might be an option to add a workaround in redmine, but it won't be pretty, so I would prefer to fix the problem in activerecord-sqlserver-adapter.

#15 Updated by John Bolthouse 12 months ago

Is there any progress on this? I would definitely like to upvote this as I have clients on Sql Server. I would also be happy to test potential solutions in our dev environments.

#16 Updated by Pavel Rosický 12 months ago

sorry, no feedback from activerecord-sqlserver-adapter's maintainers yet

but you can test my (unofficial) patch by changing the Gemfile

  when /sqlserver/
    gem "tiny_tds", "2.1.2", :platforms => [:mri, :mingw, :x64_mingw]
    gem "activerecord-sqlserver-adapter", :git => 'https://github.com/ahorek/activerecord-sqlserver-adapter.git', :branch => 'constrains_bug', :platforms => [:mri, :mingw, :x64_mingw]

on my environment it passes all activerecord-sqlserver-adapter's tests and redmine's tests. Let us know if it works for you.

#17 Updated by Pavel Rosický 10 months ago

if you're still interested, here's a patch for redmine

#18 Updated by Ricidleiv Tondatto 10 months ago

Pavel Rosický wrote:

if you're still interested, here's a patch for redmine

For those who like me had to search how to apply this patch, here the official Redmine's way.
http://www.redmine.org/projects/redmine/wiki/patch

#19 Updated by Alexander Ryabinovskiy 9 months ago

Pavel Rosický wrote:

sorry, no feedback from activerecord-sqlserver-adapter's maintainers yet

but you can test my (unofficial) patch by changing the Gemfile
[...]

on my environment it passes all activerecord-sqlserver-adapter's tests and redmine's tests. Let us know if it works for you.

Hello. They have megred your issue, as I can see?
https://github.com/ahorek/activerecord-sqlserver-adapter.git
Is this problem solved?

#20 Updated by Hiep Le 9 months ago

Hi Pavel,

Thanks for the update. Probably the problem not yet solved.
Could you please help clarify clearer with the patch file?

In Cygwin, I tried using both $ patch -p0 -i sqlserver.patch and $ patch -p0 < sqlserver.patch and none of them work.
Before using patch command, I converted the file using unix2dos but no luck. It kept failing with the LF and CRLF issue for ending line between linux and windows during file conversion.

Do I need to convert the file and what is the proper way to do? Please see the attached image.

Thank you very much!
Hiep

#21 Updated by Pavel Rosický 9 months ago

Hiep Le
ok, try to change the Gemfile instead.

  when /sqlserver/
    gem "tiny_tds", "2.1.2", :platforms => [:mri, :mingw, :x64_mingw]
    gem "activerecord-sqlserver-adapter", :git => 'https://github.com/ahorek/activerecord-sqlserver-adapter.git', :branch => 'constrains_bug', :platforms => [:mri, :mingw, :x64_mingw]

CR/LF issues is off-topic, please ask on forums if you need help
there're better alternatives than cygwin
https://rubyinstaller.org/downloads/ or https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux

Alexander Ryabinovskiy

Hello. They have megred your issue, as I can see?
https://github.com/ahorek/activerecord-sqlserver-adapter.git
Is this problem solved?

yes, it's merged, but there's no release yet. https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/releases
until that happens www.redmine.org/attachments/download/23286/sqlserver.patch might be a temporarly solution. cc Go MAEDA, your opinion?

#22 Updated by Bob Binary about 1 month ago

Go MAEDA wrote:

Redmine 4.0.0 does not work with Microsoft SQL Server.

One of the causes is that a dependent library activerecord-sqlserver-adapter does not support Rails 5.2 yet.

Hi,
any news about this? I would like to use the latest version of redmine with mssql on windows. As far as I understand the answers in this thread do not solve the problem and currently there is no way to get the latest version of redmine running on mssql?

BR,
Bob

#23 Updated by Pavel Rosický about 1 month ago

As far as I understand the answers in this thread do not solve the problem and currently there is no way to get the latest version of redmine running on mssql?
officially no, by using an unofficial patch yes. (https://www.redmine.org/issues/30285#note-16)

I'm not the maintainer of the https://github.com/rails-sqlserver/activerecord-sqlserver-adapter gem, so there's nothing more I can do. The current state of development seems to be pretty dead.

#24 Updated by Pavel Rosický 7 days ago

activerecord-sqlserver-adapter 5.2.1 has been released on 31.3.2020. We should update the Gemfile.

#25 Updated by Marius BALTEANU 7 days ago

  • Target version changed from Candidate for next minor release to 4.1.1

#26 Updated by Bob Binary 7 days ago

Great! When will 4.1.1 be released?

#27 Updated by Yuichi HARADA 6 days ago

Pavel Rosický wrote:

activerecord-sqlserver-adapter 5.2.1 has been released on 31.3.2020. We should update the Gemfile.

+1
I think it's good. I confirmed using the Docker image "mcr.microsoft.com/mssql/server:2017-latest-ubuntu".

#28 Updated by Go MAEDA 6 days ago

  • Status changed from New to Resolved
  • Assignee set to Go MAEDA
  • Resolution set to Fixed

Pavel Rosický wrote:

activerecord-sqlserver-adapter 5.2.1 has been released on 31.3.2020. We should update the Gemfile.

Committed the patch. Thank you for working hard on fixing activerecord-sqlserver-adapter.

Marius, I think we can apply the patch to 4.0-stable as well as 4.1-stable, what do you think? SQL Server support is broken in Redmine 4.0 and later.

#29 Updated by Marius BALTEANU 6 days ago

  • Target version changed from 4.1.1 to 4.0.7

Go MAEDA wrote:

Pavel Rosický wrote:

activerecord-sqlserver-adapter 5.2.1 has been released on 31.3.2020. We should update the Gemfile.

Committed the patch. Thank you for working hard on fixing activerecord-sqlserver-adapter.

Marius, I think we can apply the patch to 4.0-stable as well as 4.1-stable, what do you think? SQL Server support is broken in Redmine 4.0 and later.

Sure, good idea. I don't know why I thought that only 4.1 is affected.

#30 Updated by Go MAEDA 6 days ago

  • Status changed from Resolved to Closed

Merged r19628 to stable branches.

#31 Updated by Go MAEDA 3 days ago

  • Related to Patch #31230: Fix: migration fails in MS SQL-Server added

Also available in: Atom PDF