Server Error in Application - sql-server

Whenever I am viewing my file (file is located in shared drive) to a browser, I am getting this error:
Server Error in '/Test' Application.
Security Exception
Description: The application attempted
to perform an operation not allowed by
the security policy. To grant this
application the required permission
please contact your system
administrator or change the
application's trust level in the
configuration file.
Exception Details:
System.Security.SecurityException:
Request for the permission of type
'System.Web.AspNetHostingPermission,
System, Version=2.0.0.0,
Culture=neutral,
PublicKeyToken=b77a5c561934e089'
failed.
Source Error:
An unhandled exception was generated
during the execution of the current
web request. Information regarding the
origin and location of the exception
can be identified using the exception
stack trace below.
I contacted the System Admin, he said he has given the full access rights to my PC. What is going wrong here?

By default you can't host ASP.NET pages from a shared drive since this is an untrusted location. You will need to edit your .NET configuration to allow this location. You can find a quick guide here (The first answer): http://forums.asp.net/t/1371394.aspx
A quick test before doing that is to copy the project locally and run it. If everything works, then that is your problem. If it is important to keep the project on the shared drive you will have to follow the above steps to make it a trusted location.

Related

Is it secure to deploy an SSAS Tabular Model package impersonating a specific user?

I created an Analysis Services Tabular Project in Visual Studio.
I tried to set the Impersonation Information to "Current User":
Unfortunately, I get the following error:
Failed to save modifications to the server. Error returned: 'The datasource, '[Datasource Name]', contains an ImpersonationMode that is not supported for processing operations.
If I instead set "Impersonation Information" to "Specific Windows user name and password" and use my personal account, it works just fine.
I got error messages for all other options (other than impersonating a specific account). For example, the "Unattended Account" option gave me the following error:
Failed to save modifications to the server. Error returned: 'An unexpected error occurred (file 'pcsspi.cpp', line 926, function 'GetImpersonationIdentity').
A connection could not be made to the data source with the Name of '[Data Source Name]'.
I do not handle the deployment myself - I move the entire solution to a shared folder and the tech lead for that particular project deploys it.
That being said, are there any security implications for impersonating my account? Any chance I could compromise my credentials?
Its totally fine to impersonate a specific Windows username and password however using your personal account is not correct. Set up a service account that has limited access to just the resources the Tabular model needs for refreshing. (Whatever data sources it uses and nothing else)

Cannot deploy SSIS project - Error during execution of "encrypt_binarydata"

I have a SSIS project that I have created that has the DontSaveSensitive protection level and has happily deployed to the local server several times before today. I am now, however, getting the following error on deployment:
A .NET Framework error occurred during execution of user-defined
routine or aggregate "encrypt_binarydata":
System.IO.FileLoadException: Could not load file or assembly
'System.Core, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089' or one of its dependencies. Not
enough storage is available to process this command. (Exception from
HRESULT: 0x80070008) System.IO.FileLoadException: at
Microsoft.SqlServer.IntegrationServices.Server.Security.CryptoGraphy.CreateSymmetricKey(String
algorithm) at
Microsoft.SqlServer.IntegrationServices.Server.Security.CryptoGraphy.EncryptBinaryData(SqlString
algorithmName, SqlBytes key, SqlBytes IV, SqlBytes binaryData) .
(Microsoft SQL Server, Error: 6522)
I have had a google but come across nothing that specifically references encrypt_binarydata. There are a number of references to deploy_project_internal or untrusted assemblies but nothing on this particular issue.
The important part seems to be
Not enough storage is available to process this command
but I can't make head or tail of this as there are many gigabytes of RAM going spare and plenty of drive space to use so the resources shouldn't be problem.
Can anyone shed any light on what this error is referring to and ideally how I can resolve it?
Turns out this is a problem with permissions that gets very muddied deep down in the inner working of the SSISDB, between SQL and dll files. The error message in the original question is actually a bit of a red herring and the real problem was the same as the one solved in this excellent resolution.
For posterity's sake in case that answer ever disappears (as well as for lazy people that don't want to click another link), here is the referenced answer in full
Credit to Remus Rusanu
Assemblies with EXTERNAL_ACCESS are, through some convoluted path, falling under the EXECUTE AS path. The problem appears when the 'dbo' cannot be mapped to a valid login. dbo's login is the login with the SID the owner_sid value in sys.databases. Unless an AUTHORIZATION clause was used in CREATE DATABASE the owner_sid is the login sid of the principal issuing the CREATE DATABASE statement. Most times this is the Windows SID of the user logged in and issuing the CREATE DATABASE. With this knowledge in hand one can easily envision the problems that may arise:
copy database: CREATE DATABASE was issued on machine A by an user local to A (ie. MachineA\user or DomainA\user) then the database was copied to machine B (via backup/restore or via file copy). The owner_sid is preserved by file copy as well as by backup/restore, this on machine B the owner_sid is invalid. Everything requiring EXECUTE As fails, including loading assemblies from the database.
tombstoned account. CREATE DATABASE was issued by an user that has left the company. The AD account is deleted and all of the sudden EXECUTE AS mysteriously fails, including loading assemblies.
disconnected laptop. CREATE DATABASE was issues when the laptop was connected in the work network. At home you can log in using Windows cached credentials, but EXECUTE AS wants to connect to the unavailable AD and fails. Loading assemblies also fails. Problems mysteriously resolves itself next day at work, when you're again within reach of AD.
spotty AD connectivity. The EXECUTE AS does not uses system cached credentials and connects to the AD every time. If the AD connectivity has issues (timeout, errors) those issues manifest as similar timeouts and errors in EXECUTE AS, including loading assemblies
All these issues can be diagnosed by simply running: EXECUTE AS USER = 'dbo'; in the context of the problem db. It it fails with an error then the cause of your assembly load problems is the EXECUTE AS context of dbo.
The solution is trivial, simply force the owner_sid to a valid login. sa is the usually the best candidate:
ALTER AUTHORIZATION ON DATABASE::[<dbanme>] TO sa;
The funny thing is that the database may seem to be perfectly healthy; tables are available and you can run selects, updates, deletes, create and drop tables etc. Only certain components require EXECUTE AS:
code signing requires the code to have an EXECUTE AS clause
assembly validation
explicit EXECUTE AS in T-SQL code
Service Broker message delivery (including Query Notifications)
The latter is the most often seen culprit, as applications relying on SqlDependency all of a sudden seem to stop working, or have random problems. This article explains how SqlDependency ultimately depends on EXECUTE AS: The Mysterious Notification

Why appears C# web generation failed?

When I want to create the tables to after see the preview of my job appears this error:
error: GeneXus C# Generator:
local protection:
Not authorized
Default (C# Web) Generation Failed
error: Error in reorganization
Run Developer Menu Failed
It appears that you donĀ“t have an authorization for the .NET (C#) generator.
If you look at GeneXus License Manager, is it authorized or not?
Check out this page for more information.
The message speaks of local license so another possibility would be that you have installed your licenses remotely and the License Manager pointing locally as you see in http://www.gxopen.com/forumsr/servlet/viewthread?ARTECH,3,158064
If this is the case proceed as follows:
Open the Genexus License Manager and set there the license of the c # generator pointing to the remote machine by name or IP.-
It should also take into account a series of requirements which I do not detail in depth as it would be too long.
These requirements vary depending on whether the pc server is in the same domain or in the same workgroup as the local pc.-
In particular you should keep in mind things like:
a) Firewall with its exceptions on port 135 (DCom) and for
ProtSrv.exe application
b) User with Remote Access premition for anonymous loggin
c) Updated DNS
For more information about that last point plese see http://wiki.genexus.com/commwiki/servlet/wiki?19985,Setting+user+permissions+using+remote+licenses,

SQL Server Management Tools Installation fails with registry Wow6432Node key's (default) value

On Windows 7 x64, SQL Server 2014(x64) Management Tools installation fails with the following error;
Feature: Management Tools - Complete
Status: Failed: see logs for details
Reason for failure: An error occurred for a dependency of the feature causing the setup process for the feature to fail.
Next Step: Use the following information to resolve the error, and then try the setup process again.
Component name: SQL Server Management Services
Component error code: 1406
Component log file: C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\20140719_170948\sql_ssms_Cpu64_1.log
Error description: Could not write value to key \SOFTWARE. Verify that you have sufficient access to that key, or contact your support personnel.
I monitored installation with Process Monitor and find that it is trying to write(RegSetValue) HKLM\SOFTWARE\Wow6432Node\(Default) value which results in "Access Denied".
So, when i try to change that key's default value within regedit, it is not allowed too;
Cannot edit : Error writing the value's new contents..
For Wow6432Node key, i grant permissions to following users/groups; Everyone, Current Admin Account, Administrators, System but that did not help to change that default value even with regedit.
I could only think about registry corruption or some windows bug or may be some other program intervention, so, i disabled antivirus app. What might it be and how could i solve it?
After trying several things, finally, i applied the following and it worked. Restart may be required after applying it.
regdacl HKLM\SOFTWARE\Wow6432node /gga:F /ggu:F /ggs:F
Download regdacl here
http://www.heysoft.de/en/software/regtools.php?lang=EN

WEBMethods connection string is not working?

The following WEBMethods string is not connecting to the server on our companies network drive. I can take the string and place it in a web broswer and i will get a windows exploer screen but when run from WEBMethods the error is Access is denied.
Question: What is causing the access to be denied through WEBMethods? (I can access the file through internet explorer)
Connection String: (Names change to safe guard any information)
//ServerName/DriveName/S/AB/P/T
Error:
com.wm.app.b2b.server.ServiceException: java.io.FileNotFoundException: \\espr1fs05
\DSSXFER\SYSTEMS\ACCESS BACKUPS\Prod\Test\TBE-FILE02.txt (Access is denied)
New Code Added:
System.out.println("outputDirectory --> " + outputDirectory);
writer = new PrintWriter(new BufferedWriter(new FileWriter("doug.txt")));
I have the code in my Java service and would like to write to a network drive as a test.
allowedWritePaths=//ESPR1FS05/DSSXFER/SYSTEMS/ACCESS BACKUPS/Prod/Test;
allowedReadPaths=//ESPR1FS05/DSSXFER/SYSTEMS/ACCESS BACKUPS/Prod/Test;
allowedDeletePaths=//ESPR1FS05/DSSXFER/SYSTEMS/ACCESS BACKUPS/Prod/Test;
The above is how the fileAccessControl.cnf file is configured and this is the same path that I put into the web service for the input file. When I test a write from Java it will work.
What could be wrong with the above write paths?
Error Statements:
com.wm.app.b2b.server.ServiceException: java.io.FileNotFoundException:
\ESPR1FS05\DSSXFER\SYSTEMS\ACCESS BACKUPS\Prod\Test\T.txt (Access is denied)
com.wm.app.b2b.server.ServiceException: java.io.FileNotFoundException:
\\ESPR1FS05\DSSXFER\SYSTEMS\ACCESS BACKUPS\Prod\Test\T.txt (Access is denied)
I'm not sure but did you try reloading the WMPublic package ? Maybe the changes you made to the fileAccessControl.cnf have not been loaded into memory.
Maybe it requires a webMethods server reboot.
When you can not find a file in webMethods. There are maybe couple of reasons.
The file path is in the cache so it may different from what you think it is. Reloading the proper package will resolve it.
The webMethods flow don't have right permission to write to or read from the file. You can edit it in flow's properties window.
WebMethods server mount to the remote drive but don't have permission to read the file.
And I don't suggest directly process the remote file through webMethods. You should use FTP or SFTP to process the file in webMethods server and send it to remote drive.

Resources