Showing posts with label error. Show all posts
Showing posts with label error. Show all posts

Jul 23, 2019

Nvidia GPU driver errors

After Windows10 update Nvidia GPU driver corrupted. You can find driver downloads in Nvidia website (http://www.nvidia.com/Download/index.aspx)

Setup may not continue for some reasons. 2 errors described below.

Error1: Windows cannot verify the digital signature for this file

Disable enforced driver signing Run command line and type
shutdown /f /t 0 /r
Press "F8" and continue.
Click ‘Troubleshoot’.
Click ‘Advanced Options
Click ‘Windows Startup Settings
Click Restart.

After restart select ‘Disable driver signature enforcement‘ from the list by hitting F7. Then continue to install driver after Win10 booted.

Note: The shutdown command does not work in a RDP/Termial Session, otherwise error “The parameter is incorrect.(87)” occurs.

Error2: The graphic driver could not find compatible graphics hardware || Nvidia installer not compatible with this version of windows

Exit setup.

Go to Device Manager > Display Adapters > Select device from tree > Right click and select Properties
Go to Device tab > Select Hardware Ids from Property list
Copy first line (PCI\VEN_10DE&DEV_1BE0&SUBSYS_75071558&REV_A1) and quit

Go to Display.Driver folder which extracted from driver setup.

Open nvami.inf

Find NVIDIA Devices line: [NVIDIA_Devices.NTamd64.10.0...14310]

You will see many lines like below:
%NVIDIA_DEV.0DCE.204C.1043% = Section002, PCI\VEN_10DE&DEV_0DCE&SUBSYS_204C1043

Copy first line until PCI word: %NVIDIA_DEV.0DCE.204C.1043% = Section002,

Paste it to new line above copied line (under NVUDUA_Devices line) and then past hardwareId copied from Device Manager

%NVIDIA_DEV.0DCE.204C.1043% = Section002, PCI\VEN_10DE&DEV_1BE0&SUBSYS_75071558&REV_A1

Do same thing for the line [NVIDIA_Devices.NTamd64.10.0]

You will paste 2 newlines in total to nvami.inf file.

Save inf file to original location and run setup again.

Update

As of 23rd July something changed on Windows 10 and Nvidia setup. Check updates below.
1. If you can't reach Advanced Startup menu then lock your computer. While pressing shift key press power icon on screen and select Restart.

2. Changing inf file may not work on latest driver package. You may get following error:
Package install status code: Exception {0x800f024b - The hash for the file is not present in the specified catalog file. The file is likely corrupt or the victim of tampering.}.
3. Update Windows 10 to the latest version.
Check your version by typing winver to Windows search box to see version. Your version may be older than driver supports.

Install driver from inf file.

Press "Let me pick from a list..." option.
 Find your device in list.

Press "Have Disk" button and find inf file.

Nov 26, 2018

Cordova build errors and fixes

Creating a new cordova project

This is where we start to create a new project.
cordova create hello com.example.hello HelloWorld
Adding Android platform.
C:\hello>cordova platform add android
Using cordova-fetch for cordova-android@~7.1.1
Adding android project...
Creating Cordova project for the Android platform:
        Path: platforms\android
        Package: com.example.hello
        Name: hello
        Activity: MainActivity
        Android target: android-27
Android project created with cordova-android@7.1.2
Android Studio project detected
Android Studio project detected
Discovered plugin "cordova-plugin-whitelist" in config.xml. Adding it to the project
Installing "cordova-plugin-whitelist" for android

Adding cordova-plugin-whitelist to package.json
Saved plugin info for "cordova-plugin-whitelist" to config.xml
--save flag or autosave detected
Saving android@~7.1.2 into config.xml file ...

Run the following command to build the project for all platforms

cordova build

Build Errors

ERROR1:
Error occurred during initialization of VM
Could not reserve enough space for 2097152KB object heap
Fix
Go to Start->Control Panel->System->Advanced(tab)->Environment Variables->System
Variables->New:
Variable name: _JAVA_OPTIONS   
Variable value: -Xmx512M

Variable name: Path  
Variable value: ;C:\Program Files\Java\jre6\bin;F:\JDK\bin;  
Change this to your appropriate path.
Restart computer!
ERROR2:
File C:\Users\oktay\.android\repositories.cfg could not be loaded.
Checking the license for package Android SDK Build-Tools 26.0.2 in C:\Program Files (x86)\Android\android-sdk\licenses

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':CordovaLib'.
> You have not accepted the license agreements of the following SDK components:
  [Android SDK Build-Tools 26.0.2].
  Before building your project, you need to accept the license agreements and complete the installation of the missing components using the Android Studio SDK Manager.
  Alternatively, to learn how to transfer the license agreements from one workstation to another, go to http://d.android.com/r/studio-ui/export-licenses.html
Fix
Create license file in %ANDROID_HOME%
mkdir "%ANDROID_HOME%\licenses"
echo |set /p="8933bad161af4178b1185d1a37fbf41ea5269c55" > "%ANDROID_HOME%\licenses\android-sdk-license"
ERROR3:
Warning: License for package Android SDK Build-Tools 26.0.2 not accepted.
Fix
Manually accept the license.
C:\Program Files (x86)\Android\android-sdk\tools\bin>sdkmanager --update && yes | sdkmanager --licenses
ERROR4:
Checking the license for package Android SDK Build-Tools 26.0.2 in C:\Program Files (x86)\Android\android-sdk\licenses
License for package Android SDK Build-Tools 26.0.2 accepted.
Preparing "Install Android SDK Build-Tools 26.0.2 (revision: 26.0.2)".
Warning: Failed to read or create install properties file.

The SDK directory (C:\Program Files (x86)\Android\android-sdk) is not writeable,
  please update the directory permissions.
Fix
Give Full permission to Everyone for sdk folder ( C:\Program Files (x86)\Android\android-sdk)

Giving full permission to "ALL APPLICATION PACKAGES" and "TrustedInstaller" didn't solve my problem.
Checking the license for package Android SDK Build-Tools 26.0.2 in C:\Program Files (x86)\Android\android-sdk\licenses
License for package Android SDK Build-Tools 26.0.2 accepted.
Preparing "Install Android SDK Build-Tools 26.0.2 (revision: 26.0.2)".
...
BUILD SUCCESSFUL in 2m 55s
46 actionable tasks: 46 executed
Built the following apk(s):
        C:\hello\platforms\android\app\build\outputs\apk\debug\app-debug.apk

Build project and Emulate in Andorid

cordova build
cordova emulate android
APPENDIX: A WARNING
C:\Program Files (x86)\Android\android-sdk\tools\bin>sdkmanager
Picked up _JAVA_OPTIONS: -Xmx512M
Warning: cvc-pattern-valid: Value '' is not facet-valid with respect to pattern '[a-zA-Z0-9_-]+' for type 'idType'.
Warning: cvc-type.3.1.3: The value '' of element 'id' is not valid.
Warning: cvc-pattern-valid: Value '' is not facet-valid with respect to pattern '[a-zA-Z0-9_-]+' for type 'idType'.
Warning: cvc-type.3.1.3: The value '' of element 'id' is not valid.
Warning: File C:\Users\oktay\.android\repositories.cfg could not be loaded.
[=======================================] 100% Computing updates...
Error resolved by creating an empty repositories.cfg file.

Cordova installation info is here

Aug 10, 2018

Apt-get install error

You may get following error when you use apt-get install command.
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
Run ps command to see which processes are using apt.
# ps aux | grep apt
root       3701  0.0  0.0   4628   772 ?        Ss   01:17   0:00 /bin/sh /usr/lib/apt/apt.systemd.daily install
root       3705  0.0  0.0   4628  1680 ?        S    01:17   0:00 /bin/sh /usr/lib/apt/apt.systemd.daily lock_is_held install
_apt       3744  0.5  0.4  88960  8560 ?        S    01:18   0:00 /usr/lib/apt/methods/http
root       3755  0.0  0.0  21536  1000 pts/0    S+   01:18   0:00 grep --color=auto apt
Kill processes
# kill -9 3701
# kill -9 3705
# kill -9 3744
Check ps
# ps aux | grep apt
root       3757  0.0  0.0  21536  1028 pts/0    S+   01:18   0:00 grep --color=auto apt
After killing processes and restart apt-get install command I could install packages.

If you have interrupted apt-get session when you install a package you may see an error.
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
In this case to continue setup run:
sudo dpkg --configure -a

Jul 6, 2018

Anonymous level security token - Windows Server

During a software installation if setup fails and shows similar logs like below then it is related with Windows Component system.

MSI (c) (48:B0) SOFTWARE RESTRICTION POLICY: Verifying package --> '...\NC.x64.msi' against software restriction policy 
MSI (c) (48:B0)  Note: 1: 2262 2: DigitalSignature 3: -2147287038  
MSI (c) (48:B0)  SOFTWARE RESTRICTION POLICY: ...\NC.x64.msi is not digitally signed 
MSI (c) (48:B0) SOFTWARE RESTRICTION POLICY: ...\NC.x64.msi is permitted to run at the 'unrestricted' authorization level.
The software which I tried to install had prerequisites (Dotnet Framework 3.5 etc).
After error, I tried to install Dotnet 3.5 manually from "Server Manager" by clicking "Add roles and features" link. But it failed and showed error below:

Anonymous level security token
To solve I followed these steps:

  1. Click Start > Run, type dcomcnfg.exe
  2. Click OK if you see the UAC warning
  3. Go to Component Services> Computers in the tree
  4. Right click My Computer > select Properties.
  5. Click Default Properties tab
  6. Select Connect in the Default Authentication Level list 
  7. Select Identify in the Default Impersonation Level list
  8. Click OK, and confirm the selection
  9. Close Component Services console




Nov 27, 2015

Performance Counters on ASP.NET

If you want to use performance counters on your ASP.NET page you can use  System.Diagnostics.PerformanceCounter class. Example below shows running inside a generic handler.


static System.Diagnostics.PerformanceCounter cpuUsage;

public void ProcessRequest(HttpContext context)
{
    context.Response.ContentType = "text/plain";
    if (cpuUsage == null)
    {
        cpuUsage = new System.Diagnostics.PerformanceCounter();
        cpuUsage.CategoryName = "Processor";
        cpuUsage.CounterName = "% Processor Time";
        cpuUsage.InstanceName = "_Total";
    }

    context.Response.Write(cpuUsage.NextValue());
}


When you test in Visual Studio you will see you can get CPU usage for every call (except first call, it is 0 for the first time). But when you deploy your code to the server probably you will see the error below.
Access to the registry key 'Global' is denied. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.UnauthorizedAccessException: Access to the registry key 'Global' is denied.
To solve this problem;

1. Check your application pool from the IIS website settings (basic or advance).


2. Go to "Application Pools" section. Right click and select "Advanced Settings".


3. Find "Identity".


4. Go to "Server Manager" > "Local Users and Groups" > "Groups". On the right pane right click to "Performance Monitor Users" > Properties.



5. Add user you saw in the 3rd step (Identity). If you saw "ApplicationPoolIdentity" in the "Identity" then type "IIS APPPool\[Pool name]". In our example pool name is "ASP.NET v4.0".



6. Restart IIS. Now you should see the performance counter page without error.

Sep 11, 2008

Oracle Oci.dll Error

I am working on a new computer on these days. So i had to install programs that i need again. Whenever i install Oracle client i get oci.dll error. I have been working with Oracle since 2005. 3 years and a few installation of Oracle client. Always the same error: "OracleClient error: Could not create an environment: OCIEnvCreate returned -1".

Since the aim of this blog is helping people and giving useful information i want to mention about this general error. I read some forums about this error. I found two useful solutions.
First solution:
On the Oracle 9.2 Client software you need to give the Authenticated User privilege to the Oracle Home by following these steps:

1. Log on to Windows as a user with Administrator privileges.
2. Launch Windows Explorer from the Start Menu and and navigate to the
ORACLE_HOME directory.
3. Right-click on the ORACLE_HOME folder and choose the "Properties" option
from the drop down list. A "Properties" window should appear.
4. Click on the "Security" tab on the "Properties" window.
5. Click on "Authenticated Users" item in the "Name" list (on Windows XP the
"Name" list is called "Group or user names").
6. Uncheck the "Read and Execute" box in the "Permissions" list (on Windows
XP the "Permissions" list is called "Permissions for Authenticated Users").
This box will be under the "Allow" column.
7. Check the "Read and Execute" box. This is the box you just unchecked.
8. Click the "Apply" button.
9. Click the "OK" button.
10. Reboot your computer after these changes have been made.

Re-execute the application and it should now work.
Second solution:
1. Go to C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\CONFIG or an equivalent.
2. Open machine.config file
3. Find the line below:
<processmodel clientconnectedcheck="0:00:05" comauthenticationlevel="Connect" comimpersonationlevel="Impersonate" cpumask="0xffffffff" enable="true" idletimeout="Infinite" loglevel="Errors" maxiothreads="25" maxworkerthreads="25" memorylimit="60" password="AutoGenerate" requestlimit="Infinite" requestqueuelimit="5000" responsedeadlockinterval="00:03:00" responserestartdeadlockinterval="00:09:00" restartqueuelimit="10" shutdowntimeout="0:00:05" timeout="Infinite" username="machine" webgarden="false">
4. Change userName="machine" to userName="SYSTEM"
5. Then iisreset

Jun 30, 2008

Send .Net Runtime Error messages with Email

I have returned from vacation today. I have many works to do. I see my coworkers are not happy. Emails tell me everything. Error messages, user requests, bad test results, meetings, works, works...

In one week there are 201 .net runtime error emails. There are some problems with some developments.

We configured .net settings to emails runtime errors to us with detailed information. It is useful sometimes. But be careful, if you face many runtime errors your mailbox may be full. I recommend you to redirect error emails to your secondary email address if you have mail quota problems. If you want to use with your primary address you should filter messages and move them to new folder. So tracking error messages would be more easy.

I want to mention about how can we send error messages as we use. Our code works with .Net 1.1 version and not tested with upper versions. I think it should work with new versions.

Go to global.asax.vb and find Application_Error function. You may see "Fires when an error occurs" comment in it. In this function open try/catch block and paste code below in it.

Dim ex As Exception = Server.GetLastError().GetBaseException()
Dim ErrorMessage As String = ""
ErrorMessage = "<b>Error date :</b>" & DateTime.Now
ErrorMessage &= "<br><b>Error message : </b>" & ex.Message
ErrorMessage &= "<br><b>Error page and location :</b>" & ex.StackTrace
ErrorMessage &= "<br><b>User : </b>" & Session("ID_USER") 'If you have user info

'Submitted Form Information
ErrorMessage &= "<br><p><b><u>Form Info</u></b>"
Dim x As Integer = 0
Do While x < Request.Form.Count
ErrorMessage &= "<LI>" & Request.Form.Keys(x) & " : " & Request.Form(x) & ""
x += 1
Loop

'Server Variables
ErrorMessage &= "<p><b><u>Server Variables</u></b>"
x = 0

Do While x < Request.ServerVariables.Count
ErrorMessage &= "<LI>" & Request.ServerVariables.Keys(x) & " : " & Request.ServerVariables(x) & ""
x += 1
Loop

Dim objMsg As New System.Web.Mail.MailMessage
objMsg.BodyFormat = Mail.MailFormat.Html
objMsg.From = ConfigurationSettings.AppSettings("From")
objMsg.Subject = "Test Error! "
objMsg.To = "mail@mail.com" 'Your email address
objMsg.Body = ErrorMessage
System.Web.Mail.SmtpMail.SmtpServer = ConfigurationSettings.AppSettings("Smtp")
System.Web.Mail.SmtpMail.Send(objMsg)

Notes:
  • We keep "From" and "Smtp" variables in webconfig file. You can change it as you wish.
  • We do not email errors on production environment. Just using for test purposes.