Could not obtain information about Windows NT group/user and the user does exists - sql

I put a user into an AD group, and after that, i used the below syntax to find if he has been put:
xp_logininfo 'domain\group_name', 'members'
and find the user domain\username is listed.
And then, I checked the user's permission path, using the following statements:
xp_logininfo 'domain\user_name', 'all'
execute as user = 'domain\user_name'
None of them worked, and all showing the error message as:
Msg 15404, Level 16, State 19, Line 12
Could not obtain information about Windows NT group/user 'domain\user_name', error code 0x5.
So what happens when query this user?

The error code 0x5 indicates access denied. Here are some troubleshooting methods.
• Check the user indeed exists in the AD group.
• Check if the service account is not disabled.
• Check if the user has dataread permissions.

Related

How do I give a community user permission to PersonAccount Fields?

I have a User with a Customer Community Plus Login User License. I am getting the following error when running some code as this user that inserts a new Account record:
Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, BCH_AccountTrigger: execution of AfterInsert
caused by: System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, DDH.HC_ProgramEligibility_Trigger: execution of AfterInsert
caused by: DDH.HC_SQuery.SQueryException: Permission Denied: cannot read [Account] object field(s) {PersonBirthdate}
When I do the same as a System Admin, Everything works as expected. How do I give access to PersonBirthdate to this Customer Community Plus Login User via a permission set?
I tried searching the Object Settings for this field and could not find it.

SAP HANA How to debug / fix "insufficient privilege" Error

In SAP HANA I am trying to call a StoredProcedure with a Table Type as input parameter.
Other Input parameters work just fine. But as soon as I use a Table Type I get the error:
Failed to execute action: InternalError: dberror($.hdb.Connection.executeProcedure): 258 - SQL error, server error code: 258. insufficient privilege: Not authorized at /sapmnt/ld7272/a/HDB/jenkins_prod/workspace/8uyiojyvla/s/ptime/query/checker/query_check.cc:4003
How to fix / debug this?
In the indexserver-trace is:
[19984]{315590}[100/100235487] 2018-08-22 10:07:13.949679 i TraceContext TraceContext.cpp(01028) : UserName=SAPDBCTRL, ApplicationUserName=SM_EFWK, ApplicationName=ABAP:AS2, ApplicationSource=CL_SQL_STATEMENT==============CP:304, Client=010, StatementHash=31c1e1f5ca72868a541d58fc5a77596b, EppRootContextId=0050560204981EE782C14A33A16BC68E, EppTransactionId=47BF1E2CEE9D05A0E005B7CF04FCF981, EppConnectionId=5B7C13CC22061B08E10000000A1807AF, EppConnectionCounter=1, EppComponentName=AS2/sapas2ci_AS2_01, EppAction=EFWK RESOURCE MANAGER
[19984]{315590}[100/100235487] 2018-08-22 10:07:13.949656 w SQLScriptExecuto se_eapi_proxy.cc(00144) : Error <exception 71000258: Not authorized
> in preparation of internal statement: delete from _SYS_STATISTICS.STATISTICS_PROPERTIES where key='internal.check.store_results'
[19984]{315590}[100/100235487] 2018-08-22 10:07:13.949904 e SQLScript trex_llvm.cc(00936) : Llang Runtime Error: Exception::SQLException258: insufficient privilege: Not authorized
at main (line 63) ("_SYS_STATISTICS"."SHARED_STORE_USED_VALUES": line 8 col 5 (at pos 456))
This seems rather straightforward:
The application user (the person using SAP NetWeaver) SM_EFWK logged on in client 010 is trying to delete data from an SAP HANA statistics service table _SYS_STATISTICS.STATISTICS_PROPERTIES.
The NetWeaver/ABAP program uses a secondary database connection with the database user SAPDBCTRL.
The error Exception::SQLException258: insufficient privilege: Not authorized is thrown, because this SAPDBCTRL database user, does not have the privilege to DELETE on this table assigned to it (neither directly, nor via schema or role privilege).
If the SQL command is part of an SAP standard program, then I'd check that the recommended setup has been implemented correctly.
If this command comes from a custom program, you may want to either assign the privilege or use a different technical user as SAPDBCTRL is an SAP standard user that shouldn't be modified.

Why is my Deployment script causing me errors?

I am working on a project in visual studio 2012. Recently, I added a database project to the solution. The database already existed before I added it to the solution and everything worked fine.
Now, however, when I try to run the application I get errors. The errors are being caused by a computer-generated file called [database name].sql. At the top of the tile, it reads:
/*
Deployment script for [the database name here]
This code was generated by a tool.
Changes to this file may cause incorrect behavior and will be lost if
the code is regenerated.
*/
This file gets re-created every time the application runs. The errors that occur appear to be syntax errors. I cannot fix them because any changes I make to the file are irrelevant because a new file gets generated with each run and the errors re-appear.
I tried looking into this more online but had trouble. This is all rather new to me.
Here are some of the errors being created:
GO
:setvar DatabaseName "(the database name is here)"
which gives me three errors that read:
Error 88 SQL80001: Incorrect syntax near ':'.
Error 89 SQL80001: 'DatabaseName' is not a recognized option.
Error 90 SQL80001: Incorrect syntax near '"(the database name is here in the code)"'.
Also, there is a line of code that reads:
CREATE USER [(the domain)\(the username)] FOR LOGIN [(the domain)\(the username)];
GO
which gives the following error:
Error 119 SQL72014: .Net SqlClient Data Provider: Msg 15401, Level 16, State 1, Line 1 Windows NT user or group '(the domain)\(the username)' not found. Check the name again.
From the errors you have posted it looks like there are two issues:
Windows NT user or group '(the domain)\(the username)' not found. - The user being used to access the database doesn't exist. As it's a Windows user I'm guessing that it uses the current user's credentials.
Make sure that your instance of SQL can accept Windows logins and that you (and anyone else building the software) has the necessary access rights.
'DatabaseName' is not a recognized option. - This is more than likely also caused by the first issue, but double check that the database exists.
The error message caught me out recently as it did not relate to the cause of my problem at all. It turns out my SQL script was incorrectly written (for my case - I forgot to add IDENTITY (1,1) to my PK column) to begin with.
Moral of the story for me was to test out the SQL data file in SSMS first.

SSRS data driven subscription error

I have a data driven subscription with 71 parameters. Every-time I run my subscription I get 5 errors and 71 of 71 processed with 5 errors. But when I count my report only 66 reports have been created. I tried to check the log but couldn't find any errors other than at Microsoft.ReportingServices.Diagnostics.RevertImpersonationContext.Run(ContextBody callback)
at Microsoft.ReportingServices.Diagnostics.ExtensionClassFactory.CreateExtensionObject(Extension extConfig, Boolean typeOnly).
library!ReportServer_0-43!3b10!11/10/2015-11:46:20:: i INFO: Call to GetSystemPropertiesAction().
library!ReportServer_0-43!411c!11/10/2015-11:46:20:: e ERROR: Throwing Microsoft.ReportingServices.Diagnostics.Utilities.LogonFailedException: Logon attempt for user 'user' failed., Microsoft.ReportingServices.Diagnostics.Utilities.LogonFailedException: Log on failed. Ensure the user name and password are correct. ---> System.ComponentModel.Win32Exception: The user name or password is incorrect
at Microsoft.ReportingServices.Diagnostics.Utilities.LoginUtil.Login(String userName, IntPtr ptrPwd, String domain)
at Microsoft.ReportingServices.Diagnostics.Utilities.LoginUtil.Login(String userName, SecureStringWrapper userPwd, String domain)
at Microsoft.ReportingServices.Diagnostics.ImpersonationContext..ctor(String userName, SecureStringWrapper password, String domain)
--- End of inner exception stack trace ---;
Am I missing something,not reading the log properly? any help is appreciated. Thanks in advance!
To identify which logs are failing, you can view the report server's execution logs:
Use ReportServer
select * from ExecutionLog order by TimeStart DESC
The 'ReportID' field can be looked up in the reportserver's 'catalog' table. I find that having an SSRS report set up that queries this is invaluable.
Once you identify the reports that are failing (via the above queries) then you can try running them manually, to see if they work. If they do work, then set up a subscription for just those reports, and see if they work when run as a subscription.
If you've never had a problem with these before, my bet is that the datasources use pass-through authentication, which works when logged in, but not when run automatically.
Let us know how you get on!

Devise return incorect user ID?

I get the error shown below on sign in (via Devise)
Oddly, Rails/Devise seems to be returning a user id of '1' even though there is no user in my users table with an id of '1'. This seems to happen kind of randomly, I can't figure out what the problem is.
Here's the latest error message.
ODBC::Error: S1000 (9001) [Microsoft][SQL Server Native Client 11.0][SQL Server]The log for database '[redacted]' is not available. Check the event log for related error messages. Resolve any errors and restart the database.: EXEC sp_executesql N'UPDATE [users] SET [last_sign_in_at] = ''2012-11-12T16:58:34.020'', [current_sign_in_at] = ''2012-11-13T08:44:33.586'', [sign_in_count] = 69, [updated_at] = ''2012-11-13T08:44:33.630'' WHERE [users].[id] = 1; SELECT ##ROWCOUNT AS AffectedRows'
Here's the request params:
{"utf8"=>"✓",
"authenticity_token"=>"[redacted]=",
"user"=>{"email"=>"jkramxx#xx.com",
"password"=>"[FILTERED]",
"remember_me"=>"0"},
"commit"=>"Sign in"}
There actually is no user in the db with an id of "1", and theres nothing wrong with the server. The user jkramxx#xx.com has id of 60. ( user id 1 was deleted from the db a while ago). I thought it might be something in the session cookie so i deleted that as well).
I've seen similar odd behavior in the console, where I have been able to log in, but when I examine current_user in the debugger it shows the user having an id of '1' even though when I examine the db directly (using SQL Server Mgmt Studio) the user has id of 34 and there is no user with id of 1. Sometimes this beahvior goes away when I restart the debugger. All very random.
Any suggestions?
(Ruby 1.9.3./Rails 3.2.8 SQL Server 10 using ruby-obdc gem)