Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Continued issues with locale on MacOS #31

Closed
keithbrinks opened this issue Apr 30, 2019 · 6 comments
Closed

Continued issues with locale on MacOS #31

keithbrinks opened this issue Apr 30, 2019 · 6 comments

Comments

@keithbrinks
Copy link

Hi,

Me again digging up an old issue (see #18 and #25).

Per #25 I thought 17.3 was to include a fix for the locale issues. I have version 17.3.1.1 installed, with the latest (v5.6.1) pdo_sqlsrv driver for PHP.

My application is able to perform GET, PATCH, and DELETE requests to the database without any issues. However, when sending a POST request the driver still seems to be crashing with the following error:

terminating with uncaught exception of type std::runtime_error: collate_byname<char>::collate_byname failed to construct for en_US.UTF-8/en_US.UTF-8/en_GB.UTF-8/en_US.UTF-8/en_GB.UTF-8/en_US.UTF-8

I tried doing some of the same things as before, as far as explicitly setting the locale in my application, but it resulted in the same type of error.

I'm not sure what other information would be helpful to provide, but I'm happy to do any troubleshooting.

Thanks

@v-makouz
Copy link
Contributor

Right now it's hard to know if the issue is caused by the ODBC driver or somewhere else, like the PHP driver. To help isolate it, can you generate an ODBC trace?
To create a trace log:
run odbcinst -j to see the path to odbcinst.ini, then edit it to add

[ODBC]
Trace=yes
TraceFile=<path_to_file>

at the top of it.

Looking at it might help to see what to investigate next

@keithbrinks
Copy link
Author

Hi @v-makouz,

Here is the output of the trace file:

[ODBC][86305][1556636295.239067][SQLAllocHandle.c][377]
		Entry:
			Handle Type = 2
			Input Handle = 0x7fd09c815c00
[ODBC][86305][1556636295.239311][SQLAllocHandle.c][493]
		Exit:[SQL_SUCCESS]
			Output Handle = 0x7fd09c817c00
[ODBC][86305][1556636295.239565][SQLDriverConnectW.c][290]
		Entry:
			Connection = 0x7fd09c817c00
			Window Hdl = 0x0
			Str In = [Server={vmi-ckt-db-01,1433};UID={sa};PWD={*******};Database={STAGING_VenturaApps};MARS_Connection={Yes};Driver={ODBC Driver 17...][length = 144]
			Str Out = 0x0
			Str Out Max = 0
			Str Out Ptr = 0x7ffeec95168a
			Completion = 0
		UNICODE Using encoding ASCII 'US-ASCII' and UNICODE 'UCS-2-INTERNAL'

[ODBC][86305][1556636295.341402][__handles.c][460]
		Exit:[SQL_SUCCESS]
			Environment = 0x7fd09c02ae00
[ODBC][86305][1556636295.341786][SQLGetEnvAttr.c][157]
		Entry:
			Environment = 0x7fd09c02ae00
			Attribute = 65002
			Value = 0x7ffeec94e890
			Buffer Len = 128
			StrLen = 0x7ffeec94e874
[ODBC][86305][1556636295.343209][SQLGetEnvAttr.c][273]
		Exit:[SQL_SUCCESS]
[ODBC][86305][1556636295.343515][SQLFreeHandle.c][220]
		Entry:
			Handle Type = 1
			Input Handle = 0x7fd09c02ae00
[ODBC][86305][1556636295.343694][SQLDriverConnectW.c][914]
		Exit:[SQL_SUCCESS_WITH_INFO]                    
			Connection Out [[NULL]]
[ODBC][86305][1556636295.343930][SQLGetDiagRecW.c][535]
		Entry:
			Connection = 0x7fd09c817c00
			Rec Number = 1
			SQLState = 0x7ffeec951540
			Native = 0x106a09910
			Message Text = 0x7ffeec950d30
			Buffer Length = 1025
			Text Len Ptr = 0x7ffeec950d2e
[ODBC][86305][1556636295.344045][SQLGetDiagRecW.c][596]
		Exit:[SQL_SUCCESS]
			SQLState = [01000]
			Native = 0x106a09910 -> 5701
			Message Text = [[Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Changed database context to 'STAGING_VenturaApps'.]
[ODBC][86305][1556636295.344297][SQLGetInfo.c][236]
		Entry:
			Connection = 0x7fd09c817c00
			Info Type = SQL_DBMS_VER (18)
			Info Value = 0x7ffeec9517a0
			Buffer Length = 256
			StrLen = 0x7ffeec9516dc
[ODBC][86305][1556636295.344727][SQLAllocHandle.c][540]
		Entry:
			Handle Type = 3
			Input Handle = 0x7fd09c817c00
[ODBC][86305][1556636295.344866][SQLAllocHandle.c][1085]
		Exit:[SQL_SUCCESS]
			Output Handle = 0x7fd09c01ac00
[ODBC][86305][1556636295.345086][SQLPrepareW.c][165]
		Entry:
			Statement = 0x7fd09c01ac00
			SQL = [select [tag] from [app_telescope_monitoring]][length = 44]
[ODBC][86305][1556636295.345199][SQLPrepareW.c][346]
		Exit:[SQL_SUCCESS]
[ODBC][86305][1556636295.345411][SQLExecute.c][187]
		Entry:
			Statement = 0x7fd09c01ac00
[ODBC][86305][1556636295.349411][SQLExecute.c][357]
		Exit:[SQL_SUCCESS]
[ODBC][86305][1556636295.349595][SQLNumResultCols.c][156]
		Entry:
			Statement = 0x7fd09c01ac00
			Column Count = 0x7ffeec951cd6
[ODBC][86305][1556636295.349901][SQLNumResultCols.c][251]
		Exit:[SQL_SUCCESS]
			Count = 0x7ffeec951cd6 -> 1
[ODBC][86305][1556636295.350079][SQLRowCount.c][173]
		Entry:
			Statement = 0x7fd09c01ac00
			Row Count = 0x7ffeec951cc8
[ODBC][86305][1556636295.350358][SQLRowCount.c][247]
		Exit:[SQL_SUCCESS]
			Row Count = 0x7ffeec951cc8 -> 0
[ODBC][86305][1556636295.350499][SQLNumResultCols.c][156]
		Entry:
			Statement = 0x7fd09c01ac00
			Column Count = 0x7ffeec951d48
[ODBC][86305][1556636295.350855][SQLNumResultCols.c][251]
		Exit:[SQL_SUCCESS]
			Count = 0x7ffeec951d48 -> 1
[ODBC][86305][1556636295.350940][SQLRowCount.c][173]
		Entry:
			Statement = 0x7fd09c01ac00
			Row Count = 0x7ffeec951d48
[ODBC][86305][1556636295.351018][SQLRowCount.c][247]
		Exit:[SQL_SUCCESS]
			Row Count = 0x7ffeec951d48 -> 0
[ODBC][86305][1556636295.351106][SQLDescribeColW.c][209]
		Entry:
			Statement = 0x7fd09c01ac00
			Column Number = 1
			Column Name = 0x107c21380
			Buffer Length = 129
			Name Length = 0x7ffeec951c1e
			Data Type = 0x106bcc2b2
			Column Size = 0x106bcc2b8
			Decimal Digits = 0x106bcc2c8
			Nullable = 0x106bcc2ca
[ODBC][86305][1556636295.351255][SQLDescribeColW.c][467]
		Exit:[SQL_SUCCESS]                
			Column Name = [tag](unicode)                
			Data Type = 0x106bcc2b2 -> -9                
			Column Size = 0x106bcc2b8 -> 255                
			Decimal Digits = 0x106bcc2c8 -> 0                
			Nullable = 0x106bcc2ca -> 0
[ODBC][86305][1556636295.351394][SQLNumResultCols.c][156]
		Entry:
			Statement = 0x7fd09c01ac00
			Column Count = 0x7ffeec951be6
[ODBC][86305][1556636295.351504][SQLNumResultCols.c][251]
		Exit:[SQL_SUCCESS]
			Count = 0x7ffeec951be6 -> 1
[ODBC][86305][1556636295.351622][SQLFetchScroll.c][159]
		Entry:
			Statement = 0x7fd09c01ac00
			Fetch Orentation = 1
			Fetch Offset = 1
[ODBC][86305][1556636295.351815][SQLFetchScroll.c][356]
		Exit:[SQL_NO_DATA]
[ODBC][86305][1556636295.351940][SQLRowCount.c][173]
		Entry:
			Statement = 0x7fd09c01ac00
			Row Count = 0x7ffeec951c18
[ODBC][86305][1556636295.352016][SQLRowCount.c][247]
		Exit:[SQL_SUCCESS]
			Row Count = 0x7ffeec951c18 -> 0
[ODBC][86305][1556636295.352113][SQLFreeHandle.c][387]
		Entry:
			Handle Type = 3
			Input Handle = 0x7fd09c01ac00
[ODBC][86305][1556636295.356361][SQLFreeHandle.c][490]
		Exit:[SQL_SUCCESS]
[ODBC][86305][1556636295.410329][SQLAllocHandle.c][540]
		Entry:
			Handle Type = 3
			Input Handle = 0x7fd09c817c00
[ODBC][86305][1556636295.410455][SQLAllocHandle.c][1085]
		Exit:[SQL_SUCCESS]
			Output Handle = 0x7fd09c01ac00
[ODBC][86305][1556636295.416145][SQLPrepareW.c][165]
		Entry:
			Statement = 0x7fd09c01ac00
			SQL = [insert into [app_shopfloor_shifts] ([division_id], [cell_id], [submission_date], [shift], [no_production], [updated_at], [creat...][length = 163]
[ODBC][86305][1556636295.416265][SQLPrepareW.c][346]
		Exit:[SQL_SUCCESS]
[ODBC][86305][1556636295.416374][SQLBindParameter.c][217]
		Entry:
			Statement = 0x7fd09c01ac00
			Param Number = 1
			Param Type = 1
			C Type = -16 SQL_C_SLONG
			SQL Type = 4 SQL_INTEGER
			Col Def = 0
			Scale = 0
			Rgb Value = 0x1080cd8c0
			Value Max = 8
			StrLen Or Ind = 0x7fd09c825600
[ODBC][86305][1556636295.416454][SQLBindParameter.c][434]
		Exit:[SQL_SUCCESS]
[ODBC][86305][1556636295.416505][SQLBindParameter.c][217]
		Entry:
			Statement = 0x7fd09c01ac00
			Param Number = 2
			Param Type = 1
			C Type = -16 SQL_C_SLONG
			SQL Type = 4 SQL_INTEGER
			Col Def = 0
			Scale = 0
			Rgb Value = 0x1080cd280
			Value Max = 8
			StrLen Or Ind = 0x7fd09c825608
[ODBC][86305][1556636295.416556][SQLBindParameter.c][434]
		Exit:[SQL_SUCCESS]
[ODBC][86305][1556636295.416609][SQLBindParameter.c][217]
		Entry:
			Statement = 0x7fd09c01ac00
			Param Number = 3
			Param Type = 1
			C Type = -8 SQL_C_WCHAR
			SQL Type = -9 SQL_WVARCHAR
			Col Def = 4000
			Scale = 0
			Rgb Value = 0x107db6be8
			Value Max = 20
			StrLen Or Ind = 0x7fd09c825610
[ODBC][86305][1556636295.416654][SQLBindParameter.c][434]
		Exit:[SQL_SUCCESS]
[ODBC][86305][1556636295.416703][SQLBindParameter.c][217]
		Entry:
			Statement = 0x7fd09c01ac00
			Param Number = 4
			Param Type = 1
			C Type = -8 SQL_C_WCHAR
			SQL Type = -9 SQL_WVARCHAR
			Col Def = 4000
			Scale = 0
			Rgb Value = 0x10806ebd0
			Value Max = 10
			StrLen Or Ind = 0x7fd09c825618
[ODBC][86305][1556636295.416749][SQLBindParameter.c][434]
		Exit:[SQL_SUCCESS]
[ODBC][86305][1556636295.416807][SQLBindParameter.c][217]
		Entry:
			Statement = 0x7fd09c01ac00
			Param Number = 5
			Param Type = 1
			C Type = -16 SQL_C_SLONG
			SQL Type = 4 SQL_INTEGER
			Col Def = 0
			Scale = 0
			Rgb Value = 0x1080cd1e0
			Value Max = 8
			StrLen Or Ind = 0x7fd09c825620
[ODBC][86305][1556636295.416854][SQLBindParameter.c][434]
		Exit:[SQL_SUCCESS]
[ODBC][86305][1556636295.416900][SQLBindParameter.c][217]
		Entry:
			Statement = 0x7fd09c01ac00
			Param Number = 6
			Param Type = 1
			C Type = -8 SQL_C_WCHAR
			SQL Type = -9 SQL_WVARCHAR
			Col Def = 4000
			Scale = 0
			Rgb Value = 0x1080cd018
			Value Max = 46
			StrLen Or Ind = 0x7fd09c825628
[ODBC][86305][1556636295.416946][SQLBindParameter.c][434]
		Exit:[SQL_SUCCESS]
[ODBC][86305][1556636295.416994][SQLBindParameter.c][217]
		Entry:
			Statement = 0x7fd09c01ac00
			Param Number = 7
			Param Type = 1
			C Type = -8 SQL_C_WCHAR
			SQL Type = -9 SQL_WVARCHAR
			Col Def = 4000
			Scale = 0
			Rgb Value = 0x1080c9e28
			Value Max = 46
			StrLen Or Ind = 0x7fd09c825630
[ODBC][86305][1556636295.417097][SQLBindParameter.c][434]
		Exit:[SQL_SUCCESS]
[ODBC][86305][1556636295.417153][SQLExecute.c][187]
		Entry:
			Statement = 0x7fd09c01ac00
[ODBC][86305][1556636295.420371][SQLExecute.c][357]
		Exit:[SQL_SUCCESS]
[ODBC][86305][1556636295.420522][SQLNumResultCols.c][156]
		Entry:
			Statement = 0x7fd09c01ac00
			Column Count = 0x7ffeec951fe6
[ODBC][86305][1556636295.420622][SQLNumResultCols.c][251]
		Exit:[SQL_SUCCESS]
			Count = 0x7ffeec951fe6 -> 0
[ODBC][86305][1556636295.420679][SQLRowCount.c][173]
		Entry:
			Statement = 0x7fd09c01ac00
			Row Count = 0x7ffeec951fd8
[ODBC][86305][1556636295.420724][SQLRowCount.c][247]
		Exit:[SQL_SUCCESS]
			Row Count = 0x7ffeec951fd8 -> 1
[ODBC][86305][1556636295.420768][SQLNumResultCols.c][156]
		Entry:
			Statement = 0x7fd09c01ac00
			Column Count = 0x7ffeec952058
[ODBC][86305][1556636295.420812][SQLNumResultCols.c][251]
		Exit:[SQL_SUCCESS]
			Count = 0x7ffeec952058 -> 0
[ODBC][86305][1556636295.420853][SQLRowCount.c][173]
		Entry:
			Statement = 0x7fd09c01ac00
			Row Count = 0x7ffeec952058
[ODBC][86305][1556636295.420895][SQLRowCount.c][247]
		Exit:[SQL_SUCCESS]
			Row Count = 0x7ffeec952058 -> 1
[ODBC][86305][1556636295.420950][SQLFreeHandle.c][387]
		Entry:
			Handle Type = 3
			Input Handle = 0x7fd09c01ac00
[ODBC][86305][1556636295.426233][SQLFreeHandle.c][490]
		Exit:[SQL_SUCCESS]
[ODBC][86305][1556636295.427120][SQLAllocHandle.c][540]
		Entry:
			Handle Type = 3
			Input Handle = 0x7fd09c817c00
[ODBC][86305][1556636295.427238][SQLAllocHandle.c][1085]
		Exit:[SQL_SUCCESS]
			Output Handle = 0x7fd09c01ac00
[ODBC][86308][1556636303.063610][__handles.c][460]
		Exit:[SQL_SUCCESS]
			Environment = 0x7ffd3802ac00
[ODBC][86308][1556636303.063800][SQLSetEnvAttr.c][189]
		Entry:
			Environment = 0x7ffd3802ac00
			Attribute = SQL_ATTR_ODBC_VERSION
			Value = 0x3
			StrLen = -6
[ODBC][86308][1556636303.063967][SQLSetEnvAttr.c][381]
		Exit:[SQL_SUCCESS]
[ODBC][86308][1556636303.064076][SQLSetEnvAttr.c][189]
		Entry:
			Environment = 0x7ffd3802ac00
			Attribute = SQL_ATTR_CONNECTION_POOLING
			Value = 0x0
			StrLen = -5
[ODBC][86308][1556636303.064162][SQLSetEnvAttr.c][381]
		Exit:[SQL_SUCCESS]
[ODBC][86308][1556636303.064296][__handles.c][460]
		Exit:[SQL_SUCCESS]
			Environment = 0x7ffd38031000
[ODBC][86308][1556636303.064386][SQLSetEnvAttr.c][189]
		Entry:
			Environment = 0x7ffd38031000
			Attribute = SQL_ATTR_ODBC_VERSION
			Value = 0x3
			StrLen = -6
[ODBC][86308][1556636303.064506][SQLSetEnvAttr.c][381]
		Exit:[SQL_SUCCESS]
[ODBC][86308][1556636303.064622][SQLSetEnvAttr.c][189]
		Entry:
			Environment = 0x7ffd38031000
			Attribute = SQL_ATTR_CONNECTION_POOLING
			Value = 0x2
			StrLen = -5
[ODBC][86308][1556636303.064759][SQLSetEnvAttr.c][381]
		Exit:[SQL_SUCCESS]
[ODBC][86308][1556636303.079269][SQLFreeHandle.c][220]
		Entry:
			Handle Type = 1
			Input Handle = 0x7ffd3802ac00
[ODBC][86308][1556636303.079653][SQLFreeHandle.c][220]
		Entry:
			Handle Type = 1
			Input Handle = 0x7ffd38031000
[ODBC][86311][1556636303.321305][__handles.c][460]
		Exit:[SQL_SUCCESS]
			Environment = 0x7ff227846400
[ODBC][86311][1556636303.321435][SQLSetEnvAttr.c][189]
		Entry:
			Environment = 0x7ff227846400
			Attribute = SQL_ATTR_ODBC_VERSION
			Value = 0x3
			StrLen = -6
[ODBC][86311][1556636303.323035][SQLSetEnvAttr.c][381]
		Exit:[SQL_SUCCESS]
[ODBC][86311][1556636303.323311][SQLSetEnvAttr.c][189]
		Entry:
			Environment = 0x7ff227846400
			Attribute = SQL_ATTR_CONNECTION_POOLING
			Value = 0x0
			StrLen = -5
[ODBC][86311][1556636303.323411][SQLSetEnvAttr.c][381]
		Exit:[SQL_SUCCESS]
[ODBC][86311][1556636303.323572][__handles.c][460]
		Exit:[SQL_SUCCESS]
			Environment = 0x7ff22782fa00
[ODBC][86311][1556636303.323671][SQLSetEnvAttr.c][189]
		Entry:
			Environment = 0x7ff22782fa00
			Attribute = SQL_ATTR_ODBC_VERSION
			Value = 0x3
			StrLen = -6
[ODBC][86311][1556636303.323802][SQLSetEnvAttr.c][381]
		Exit:[SQL_SUCCESS]
[ODBC][86311][1556636303.323868][SQLSetEnvAttr.c][189]
		Entry:
			Environment = 0x7ff22782fa00
			Attribute = SQL_ATTR_CONNECTION_POOLING
			Value = 0x2
			StrLen = -5
[ODBC][86311][1556636303.324023][SQLSetEnvAttr.c][381]
		Exit:[SQL_SUCCESS]
[ODBC][86311][1556636303.324712][SQLFreeHandle.c][220]
		Entry:
			Handle Type = 1
			Input Handle = 0x7ff227846400
[ODBC][86311][1556636303.324795][SQLFreeHandle.c][220]
		Entry:
			Handle Type = 1
			Input Handle = 0x7ff22782fa00
[ODBC][86312][1556636303.510588][__handles.c][460]
		Exit:[SQL_SUCCESS]
			Environment = 0x7fe4e503f000
[ODBC][86312][1556636303.511803][SQLSetEnvAttr.c][189]
		Entry:
			Environment = 0x7fe4e503f000
			Attribute = SQL_ATTR_ODBC_VERSION
			Value = 0x3
			StrLen = -6
[ODBC][86312][1556636303.512215][SQLSetEnvAttr.c][381]
		Exit:[SQL_SUCCESS]
[ODBC][86312][1556636303.512347][SQLSetEnvAttr.c][189]
		Entry:
			Environment = 0x7fe4e503f000
			Attribute = SQL_ATTR_CONNECTION_POOLING
			Value = 0x0
			StrLen = -5
[ODBC][86312][1556636303.512434][SQLSetEnvAttr.c][381]
		Exit:[SQL_SUCCESS]
[ODBC][86312][1556636303.512577][__handles.c][460]
		Exit:[SQL_SUCCESS]
			Environment = 0x7fe4e5008400
[ODBC][86312][1556636303.512672][SQLSetEnvAttr.c][189]
		Entry:
			Environment = 0x7fe4e5008400
			Attribute = SQL_ATTR_ODBC_VERSION
			Value = 0x3
			StrLen = -6
[ODBC][86312][1556636303.512825][SQLSetEnvAttr.c][381]
		Exit:[SQL_SUCCESS]
[ODBC][86312][1556636303.512924][SQLSetEnvAttr.c][189]
		Entry:
			Environment = 0x7fe4e5008400
			Attribute = SQL_ATTR_CONNECTION_POOLING
			Value = 0x2
			StrLen = -5
[ODBC][86312][1556636303.513006][SQLSetEnvAttr.c][381]
		Exit:[SQL_SUCCESS]
[ODBC][85660][1556636306.279033][SQLFreeHandle.c][220]
		Entry:
			Handle Type = 1
			Input Handle = 0x7fd09c815c00
[ODBC][85660][1556636306.279306][SQLFreeHandle.c][220]
		Entry:
			Handle Type = 1
			Input Handle = 0x7fd09c802e00
[ODBC][86312][1556636327.825530][SQLFreeHandle.c][220]
		Entry:
			Handle Type = 1
			Input Handle = 0x7fe4e503f000
[ODBC][86312][1556636327.825684][SQLFreeHandle.c][220]
		Entry:
			Handle Type = 1
			Input Handle = 0x7fe4e5008400

@v-makouz
Copy link
Contributor

The ODBC driver sets the locale in SQLDriverConnect, and that was successful it's probably not the ODBC driver. I've alerted pdo_sqlsrv support, they should be able to take a look at this soon.

@yitam
Copy link

yitam commented Apr 30, 2019

hi @keithbrinks I remember you've reported a similar problem in issue 909. Any difference this time other than using a more recent pdo_sqlsrv driver?

@keithbrinks
Copy link
Author

Hi @yitam,

There does not appear to have been any changes other than updating the drivers.

I know I reported at the end of that that things seemed to be working, but that ended up being premature. I can't recall the specifics, but I essentially gave up after that.

@v-makouz
Copy link
Contributor

Closing as this has been confirmed to be not the ODBC driver issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants