SAP.Middleware.Connector.RfcSerializationException: End mark of RFCID.TableContLZ not found - c#

I have a problem. I am trying to get data from SAP using a desktop app developed. When i connect to the VPN and run the application it runs smoothly with no errors, but when a customers try to run it from his machine it receive the folowing error and the application crashes. Can someone help me with this.
2019-03-25 15:22:29,581 [9] FATAL SAP_TO_DB.Connection - SAP.Middleware.Connector.RfcSerializationException: End mark of RFCID.TableContLZ not found. at SAP.Middleware.Connector.RfcConnection.ReadRfcIDEnd(RFCID rid) at SAP.Middleware.Connector.RfcConnection.ReadUpTo(RFCGET readState, RfcFunction function, RFCID toRid) at SAP.Middleware.Connector.RfcConnection.RfcReceive(RfcFunction function) at SAP.Middleware.Connector.RfcFunction.RfcDeserialize(RfcConnection conn, IRfcIOStream stream) at SAP.Middleware.Connector.RfcFunction.RfcCallReceive(RfcConnection conn, IRfcIOStream stream, RFCID rid) at SAP.Middleware.Connector.RfcFunction.RfcCallReceive(RfcConnection conn) at SAP.Middleware.Connector.RfcFunction.Invoke(RfcDestination destination) at SAP_TO_DB.Connection.GetOnlyData(String tableName, String userName, String password, String client, String serverName, String sysNo, String optionString, Int32 rowSkips, Int32 rowCount, IRfcTable fields)
Edit: when testing on the same vpn he gets another error:
2019-03-26 14:28:16,039 [1] FATAL SAP_TO_DB.MainForm - SAP.Middleware.Connector.RfcCommunicationException: destination Custom_destination_ failed when calling RFC_METADATA_GET -- see log for details at SAP.Middleware.Connector.RfcRepository.Execute(RfcFunction function) at SAP.Middleware.Connector.RfcRepository.LookupFunctionMetadataNew(String name) at SAP.Middleware.Connector.RfcRepository.LookupFunctionMetadata(String name) at SAP.Middleware.Connector.RfcRepository.GetFunctionMetadata(String name) at SAP.Middleware.Connector.RfcRepository.CreateFunction(String name) at SAP_TO_DB.Connection.GetOnlyHeader(String tableName, String userName, String password, String client, String serverName, String sysNo, String tableFileName, Boolean isDescriptionTable) at SAP_TO_DB.MainForm.button2_Click(Object sender, EventArgs e)
There is not much about this anywhere, therefore any help is more than welcome

These are two separate problems:
First problem "End mark of RFCID.TableContLZ not found."
Most probable reason is that the data got corrupted/truncated on the network layer. If you activate RFC trace on backend side and in the .NET program, you can compare the response data that was sent by the backend and the data that was received by the .NET program. (RFC trace contains a binary network dump, if the level is high enough.)
If the traces differ, the data was modified during network transmission. If they are the same, that means the backend system already sent corrupted data. --> Open an SAP ticket in that case to have it investigated.
Second problem "Custom_destination_ failed when calling RFC_METADATA_GET"
Could it be that the parameter RfcRepository.UseRoundtripOptimization is set to true, but your customer's backend does not yet support it? (See note 1456826 for the necessary prerequisites for using this feature.)
If that is not the problem, again an RFC trace would be helpful.

Related

IBM.Data.DB2.Core error in new DB2Connection(connectionString)

We have the IBM.Data.DB2.Core (3.1.0.300) nuget package installed in our .netstandard2.1 application library, to connect to an external DB2 instance on prem.
On running the following code from a .net core azure function v3 Windows 64bit (from a netcoreapp3.1 project)
var connectionString= "Server=DB2_IP:DB2_Port;Database=DB2_DBNAME;UID=DB2_UserId;PWD=DB2_Password;"
var connection = new DB2Connection(connectionString);
(note the values in the connection string are placeholders for anonymity)
We are receiving the following error
IBM.Data.DB2.Core.DB2Exception (0x80004005): ERROR [58005] [IBM][DB2.NET] SQL0902 An unexpected
exception has occurred in
Process: 21308 Thread 33 AppDomain: Name:Microsoft.Azure.WebJobs.Script.WebHost
There are no context policies. Function: AESEncryptADONET (Encryption Info)
CallStack: at System.Environment.get_StackTrace()
at IBM.Data.DB2.Core.DB2ConnPool.HandleUnknownErrors(String strFncMsg, Exception exception, Boolean bThrow)
at IBM.Data.DB2.Core.DB2ConnPool.EncryptString(String value)
at IBM.Data.DB2.Core.DB2ConnPool.ReplaceConnectionStringParms(DB2Connection connection, String szValue, DB2ConnSettings& pSettings, DB2ConnSettingsInternal& pSettingsInternal, Boolean bAttach, Boolean pushDownStrAppended)
at IBM.Data.DB2.Core.DB2Connection.set_ConnectionString(String value)
at IBM.Data.DB2.Core.DB2Connection..ctor(String connectionString)
Does anyone have any idea where we're going wrong, or alternatively have a coherent end-to-end guide on the setup that may give me a clue.
All documentations I have found thus far has been rather sparse and a little inconsistent.

SharePoint 2010 Web Part Error - Exception from HRESULT: 0x80131904

A client of ours recently encountered a problem with a web part I wrote a while back. This web part is an advanced search which returns results based on information entered into a text box and the criteria selected from a drop down. This web part has been functional on other customer sites and the error which is now encountered by this one client could not be replicated, even after extensive testing on our development environment. This error only appears when the search column is a lookup field and works as expected on any other field type. I have looked around the web to find a resolution specific to my problem, but the majority of the cases refer to an SQL error of the Content Database being out of space, which I don't believe is the case in my instance.
Below is the full stack trace message we receive. Any help to resolve this problem would be very much appreciated!
Exception from HRESULT: 0x80131904 at Microsoft.SharePoint.SPGlobal.HandleComException(COMException comEx)
at
Microsoft.SharePoint.Library.SPRequest.GetListItemDataWithCallback2(IListItemSqlClient
pSqlClient, String bstrUrl, String bstrListName, String bstrViewName,
String bstrViewXml, SAFEARRAYFLAGS fSafeArrayFlags,
ISP2DSafeArrayWriter pSACallback, ISPDataCallback pPagingCallback,
ISPDataCallback pPagingPrevCallback, ISPDataCallback
pFilterLinkCallback, ISPDataCallback pSchemaCallback, ISPDataCallback
pRowCountCallback, Boolean& pbMaximalView) at
Microsoft.SharePoint.SPListItemCollection.EnsureListItemsData() at
Microsoft.SharePoint.SPListItemCollection.GetEnumerator() at
Biz_AdvancedListSearch_Module.AdvancedListSearch.AdvancedListSearch.btnSearch_Click(Object
sender, ImageClickEventArgs e)
EDIT: The problem only arises when the lookup column uses the "contains" search criteria. I use CAML Queries to retrieve the data and using a console application, I determined that this was definitely possible with a lookup field.
A little old, but I had the same issue today. The comparers are case sensitive. should be . In my case, it was , changed to and it works now!

Does LibGit2Sharp support cloning a repository from the local file system?

I am trying to clone a git repository from the local file system:
using System;
using LibGit2Sharp;
class Program
{
static void Main()
{
var sourceUrl = #"file:///c:/work/libgit2sharp";
using (Repository.Clone(sourceUrl, "targetDir", bare: true))
{
Console.WriteLine("repository successfully cloned");
}
}
}
and I get an exception:
Unhandled Exception: LibGit2Sharp.LibGit2SharpException: An error was raised by libgit2. Category = Odb (Error).
Failed to find the memory window file to deregister
at LibGit2Sharp.Core.Ensure.Success(Int32 result, Boolean allowPositiveResult) in c:\work\libgit2sharp\LibGit2Sharp\Core\Ensure.cs:line 85
at LibGit2Sharp.Core.Proxy.git_clone_bare(String url, String workdir, git_transfer_progress_callback transfer_cb) in c:\work\libgit2sharp\LibGit2Sharp\Core\Proxy.cs:line 219
at LibGit2Sharp.Repository.Clone(String sourceUrl, String workdirPath, Boolean bare, Boolean checkout, TransferProgressHandler onTransferProgress, CheckoutProgressHandler onCheckoutProgress) in c:\work\libgit2sharp\LibGit2Sharp\Repository.cs:line 431
at Program.Main() in c:\work\ConsoleApplication1\Program.cs:line 10
I've also tried the following source url:
var sourceUrl = #"c:\work\libgit2sharp\.git\";
and got another exception:
Unhandled Exception: LibGit2Sharp.LibGit2SharpException: An error was raised by libgit2. Category = Config (Error).
Failed to parse config file: Unexpected end of file while parsing multine var (in c:/work/ConsoleApplication1/bin/Debug/targetDir/config:23, column 0)
at LibGit2Sharp.Core.Ensure.Success(Int32 result, Boolean allowPositiveResult) in c:\work\libgit2sharp\LibGit2Sharp\Core\Ensure.cs:line 85
at LibGit2Sharp.Core.Proxy.git_clone_bare(String url, String workdir, git_transfer_progress_callback transfer_cb) in c:\work\libgit2sharp\LibGit2Sharp\Core\Proxy.cs:line 219
at LibGit2Sharp.Repository.Clone(String sourceUrl, String workdirPath, Boolean bare, Boolean checkout, TransferProgressHandler onTransferProgress, CheckoutProgressHandler onCheckoutProgress) in c:\work\libgit2sharp\LibGit2Sharp\Repository.cs:line 431
at Program.Main() in c:\work\ConsoleApplication1\Program.cs:line 12
targetDir is never created.
If on the other hand I use HTTP transport, the Repository.Clone method works fine:
var sourceUrl = "https://github.com/libgit2/libgit2sharp";
So my question is if I am doing something wrong or if this is unsupported feature or a bug in the native git2.dll?
So my question is if I am doing something wrong or if this is unsupported feature or a bug in the native git2.dll?
A bit a both, actually.
The first exception is clearly a bug. This should not happen and will be troubleshot.
The second one requires a deeper analysis. Would you be so kind as to open a issue in the LibGit2Sharp project?
Good news are that a pull request from BenStraub was recently merged. This pull request implements the local fetch transport which should pretty solve the issue.
LibGit2Sharp will be updated in the following days with a new a new version of libgit2 binaries which should allow you perform a local clone/fetch. I'll update this answer as soon as it's been done.
Update
This test shows how do to a Clone and a Push over against a local repository.

Active Directory custom attribute can not be seen by it's owner on some computers

A added a custom attribute to the Active Directory Schema. On one machine when I try to query the attribute I get errors back from my code.
Here is the C# version to test this out.
static class Program
{
static void Main()
{
Console.ReadLine();
DirectoryEntry directoryEntry = (DirectoryEntry)UserPrincipal.Current.GetUnderlyingObject();
//Execption on this line
var allowedDatabases = directoryEntry.Properties["vwDBAccess"];
foreach (var record in allowedDatabases.OfType<String>())
{
Console.WriteLine(record);
}
Console.ReadLine();
}
}
System.Runtime.InteropServices.COMException was unhandled
Message=Unknown error (0x8000500c)
Source=System.DirectoryServices
ErrorCode=-2147463156
StackTrace:
at System.DirectoryServices.PropertyValueCollection.PopulateList()
at System.DirectoryServices.PropertyValueCollection..ctor(DirectoryEntry entry, String propertyName)
at System.DirectoryServices.PropertyCollection.get_Item(String propertyName)
at Sandbox_Console.Program.Main() in C:\Users\srchamberlain.VW\documents\visual studio 2010\Projects\Sandbox Console\Sandbox Console\Program.cs:line 16
InnerException:
The Error Code 0x8000500c represents E_ADS_CANT_CONVERT_DATATYPE. This only happens on one machine. I have 3 other computers (all part of the same domain as the first computer) and those behave correctly when running the exact same code for the exact same user and give the the content of the attribute. Also if I run as a different user, on the same box, but query the bad user's attributes I can pull up the information correctly when connecting as another user.
I have tried refreshing the schema on the box using the technique from this KB article but the issue is still happening.
What is going wrong on this one computer?
Clarification:
vwDBAccess is a multivalued string, so when it works directoryEntry.Properties["vwDBAccess"] return a string with there is one item, sting[] when there is more than one, and null when there are no items. This account has 3 items set. When I run as a different user and query the bad user I correctly get string[3] returned.
Typically if something is only happening on one machine in a network then it boils down to service pack and update levels of the OS or interaction with other software on the system (A/V is the worst offender).
The first thing I would do is look at the SP and updates applied to the working machines, then compare that to the non-working one. You should see one of two situations:
If the working machines are more up to date, then apply whatever updates are necessary to the non-working machine.
If the working machines are less up to date, then update one and see if it starts failing. If that's the case, you might need to contact MS.
My gut says that the non-working machine is simply out of date.

"Invalid Argument" exception message on IBM.Data.DB2.DB2Connection .open method

So I'm getting a fantastically descriptive error message of "Invalid Argument" when trying to hook up to a DB2 database. I can successfully connect to it using SQUirrel (and JDBC) using the JTopen JDBC driver with the connection string of "jdbc:as400://server;naming=system;errors=full;prompt=no"
Since the jdbc connection works, I know its a Db2.net connector issue. But the error message "Invalid Argument" frustrates any efforts into diagnosing where to begin.
string connStr = "server=server;uid=user;pwd=password";
using(DB2Connection conn=new DB2Connection(connStr))
{
conn.Open();
//System.ArgumentException: Invalid argument
// at IBM.Data.DB2.DB2ConnPool.ReplaceConnectionStringParms(DB2Connection connection, String szValue, DB2ConnSettings& pSettings, DB2ConnSettingsInternal& pSettingsInternal, Boolean bAttach)
// at IBM.Data.DB2.DB2Connection.set_ConnectionString(String value)
// at IBM.Data.DB2.DB2Connection..ctor(String connectionString)
// at AuroraDAL_ConnectionTests.DB2ConnectionTests.try1() in C:\Projects\...\DB2ConnectionTests.cs:line 31
// at AuroraDAL_ConnectionTests.DB2ConnectionTests.Execute() in C:\Projects\...\DB2ConnectionTests.cs:line 19
// at AuroraDAL_ConnectionTests.Program.Main(String[] args) in C:\Projects\...\Program.cs:line 20
}
Using the testconn20.exe within the DB2.net connector program files directory, I tried several options, taking the first connection string above, to then changing the shorthand keys to their longhand values, (uid changed to user id, pwd changed to password, etc)
testconn20 server=server;database=database;user id=userid;password=password
the result of that returns the same "Invalid Argument" exception eventually:
Step 1: Printing version info
.NET Framework version: 2.0.50727.5448
64-bit
DB2 .NET provider version: 9.0.0.2
Capability bits: ALLDEFINED
Build: 20090522
Factory for invairant name IBM.Data.DB2 verified
Elapsed: 0.089982
Step 2: Connecting using "server=-------;database=------;userid=------;password=------"
Invalid Argument Exception:
Connection string should be of the type 'Database=db2db; Server=mymachine:60000; User ID=db2user; Password=xxxxxxxx
Test failed.
Does anybody with some DB2 and C# have any suggestions as to what i'm doing wrong? THanks in advance.
I have no DB2 experience, but looking carefully at your code I noticed that you don't specify the Database= and the PortNumber in Server= of your connection string
It appears that IBMs site doesnt direct you to latest and greatest bits of their .net data connector. The problem was mostly solved by thoroughly looking for updates and finding their "Fix Central". This is where they keep updates and hot fixes. However it was not easy to get the right package.
finally I create the correct connection string:
Database=DBNAME;Server=IP:PORT;UID=USERNAME;Pwd=MYPASSWORD;LibraryList=LIBRARYNAME;PersistSecurityInfo=True;
For more parameters consult this: DB2Connection.ConnectionString property
https://www.ibm.com/docs/en/db2/9.7?topic=properties-connectionstring

Categories

Resources