Adplus dump creation failed - access is denied - windbg

I'm trying to get a dump to debug some memory issues in ASP.NET processes (Windows 2003 R2 SP2 x64):
adplus -hang -o f:\dumps -pn w3wp.exe -quiet
There are nine w3wp.exe (all from different websites). Everytime I run adplus as above some of the dumps fail with this error:
WriteFullMemory.Memory.Read(0x100ea0000, 0x10000) failed 0x80070005, ABORT.
Dump creation failed, Win32 error 0n5
"Access is denied."
The failure seems to be random (or I should say I can't find the reasons), i.e. sometimes some processes dump fine and sometimes they fail with this error. Things I checked:
I do have full administration permissions
There is plenty space on the target hard drive
I disabled pinging and failure protection on IIS to prevent IIS from killing the processes while adplus is dumping.
Anything else I should check? Has anyone else run into this issue? Adplus version is 7.01.002 (02/27/2009) (downloaded a couple of days ago from the latest SDK)

This is because of inaccessible memory read failure. To avoid this you could use something like cdb/windbg and use .dump /mA command to generate full memory dump.
The .dump /mA same as .dump /ma except that it will ignore inaccessible memory read failure and continue minidump generation.
.dump options
The /mA option is equivalent to /ma
except that it ignores any failure to
read inaccessable memory and continues
generating the minidump.
HTH

It wouldn't matter if you are a member of admin you would still need to elevate privileges.
ADPlus needs to be run from a command prompt running under a local administrator account with elevated privileges. If you fail to do this, the dump file may not be created.

Related

Postgresql 12 Install on Windows 10 keep failling with Administrative Permissions error

Seeking help from the Postgresql experts here. I had given up on this about 6 months ago after failing miserably to finding a solution to installing v12.10 on my company's laptop running Win 10.
I just started to pick this up again and immediately started to resume losing hair. My issue is with the initDB part of the installation and its "user with administrative permissions" error.
I have tried multiple attempts with a new signons as non-domain/non-administrative users, only members of the Users group and getting the same exact error.
I have also tried non-install, unzipped approaches and manually running initDB with the same exact error.
I have tried locating the data folder outside program files and have checked folder permissions.
I have tried creating postgres user separately - (though I understand this is no longer needed for the newer versions).
I have tried users with admin rights as well.
I have tried with v12 and v13.
They all result in the same exact error...
Again using a signon as a non-administrative user with full permissions on the data folder.
fixing permissions on existing directory C:/Program Files/PostgreSQL/12/data ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... windows
selecting default max_connections ... 20
selecting default shared_buffers ... 400kB
selecting default time zone ... America/Los_Angeles
creating configuration files ... ok
running bootstrap script ... Execution of PostgreSQL by a user with administrative permissions is not permitted.
The server must be started under an unprivileged user ID to prevent possible system security compromises. See the documentation for more information on how to properly start the server.
child process exited with exit code 1
initdb: removing contents of data directory "C:/Program Files/PostgreSQL/12/data"
Called Die(Failed to initialise the database cluster with initdb)...
Failed to initialise the database cluster with initdb
Script stderr:
Program ended with an error exit code
I am truly baffled as to what the issue is as I've installed this without issues on my personal computer but I really needed this on my work laptop.
This is relevant code is in the pgwin32_is_admin module which seems to consistently result in a TRUE for my Windows 64 platform:
for (x = 0; x < Groups->GroupCount; x++)
{
if ((EqualSid(AdministratorsSid, Groups->Groups[x].Sid) && (Groups->Groups[x].Attributes & SE_GROUP_ENABLED)) ||
(EqualSid(PowerUsersSid, Groups->Groups[x].Sid) && (Groups->Groups[x].Attributes & SE_GROUP_ENABLED)))
{
success = TRUE;
break;
}
}
It is called in this section of the check_root module:
#else /* WIN32 */
if (pgwin32_is_admin())
{
write_stderr("Execution of PostgreSQL by a user with administrative permissions is not\n"
"permitted.\n"
"The server must be started under an unprivileged user ID to prevent\n"
"possible system security compromises. See the documentation for\n"
"more information on how to properly start the server.\n");
exit(1);
}} #endif /* WIN32 */
Could someone explain how a non-administrative, non-domain user can result in a TRUE with pgwin32_is_admin on my install? My preference is to not modify/bypass this security check but guidance will be hugely appreciated.
Thanks a bunch

Get databases from old PostgreSQL folder (win 10)

I need to get databases from the old PostgreSQL folder that was in Program Files (win 10).
I tried changing the data path through the registry (ImagePath
value after "-D" at HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\postgresql-x64-12) from the current to the old PostgreSQL data folder.
I also tried replacing files in the current folder from PostgreSQL with old ones (replaced data for C:\Program Files\PostgreSQL\12\data\base and C:\Program Files\PostgreSQL\12\data\global).
In both cases, an error occurred when trying to start the postgresql-x64-12 service. Error message: the postgresql-x64-12 service on local computer started and then stopped. Some services stop automatically if they are not in use by other services or programs.
How can I get databases from old ../Program Files/PostgreSQL folder?
After replacing the folders C:\Program Files\PostgreSQL\12\data\base and C:\Program Files\PostgreSQL\12\data\global with the old ones and attempts to start the postgresql-x64-12 service, a log file appeared with the following content:
LOG: database system was shut down at ...
LOG: invalid primary checkpoint record
PANIC: could not locate a valid checkpoint record
LOG: startup process (PID 17452) was terminated by exception 0xC0000409
HINT: See C include file "ntstatus.h" for a description of the hexadecimal value.
LOG: aborting startup due to startup process failure
LOG: database system is shut down
Because of the message PANIC: could not locate a valid checkpoint record, I used pg_resetwal: in PowerShell I opened the folder C:\Program Files\PostgreSQL\12\bin, then ran the command .\pg_resetwal.exe -f -D "C:\Program Files\PostgreSQL\12\data. In some cases, it is worth using the command without -f, also for other versions of Postgres a different command may be needed. More information: https://stackoverflow.com/a/8812934/14145682.
After that, the service also did not start, and the following error was present in the log:
FATAL: could not access status of transaction
DETAIL: Could not read from file "pg_multixact/members/0000" at offset 8192: read too few bytes.
So, I replaced the files in the C:\Program Files\PostgreSQL\12\data\pg_multixact folder with the old ones.
After these steps, the postgresql-x64-12 service started without errors and it was possible to restore the old database.

psql: FATAL: could not open file "base/11951/11717": Read-only file system

I'm trying to access the postgreSQL database from CLI. When I login as postgres and enter command
I'm getting error
psql: FATAL: could not open file "base/11951/11717": Read-only file system
I'm new to this. Any pointers on where to look at would be a great help. TIA
Seems like the VM where the database was hosted went to Read-only mode for an unknown issue.
$ fsck
command helped to repair linux filesystems and was able to access psql db.
Most likely your system has detected disk errors and put the filesystem in read-only mode to protect its self from possible corruption.
Check dmesg and the kernel log files.
I strongly advise you to read and act on https://wiki.postgresql.org/wiki/Corruption .
Sometimes It indicates that the server had a general error...(Happened to me yesterday, the moment the server was restarted, the "FATAL: could not open file" disappeared.

how to start cassandra server

I'm trying to start cassandra server
C:\Program Files\DataStax Community\apache-cassandra\bin>cassandra
but it is giving me the following error:
WARNING! Powershell script execution unavailable.
Please use 'powershell Set-ExecutionPolicy Unrestricted' on this user-account to run cassandra with fully featured functionality on this platform.
Starting with legacy startup options
Starting Cassandra Server
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
I also tried powershell Set-ExecutionPolicy Unrestricted but still gives some errors... like
C:\Program Files\DataStax Community\apache-cassandra\bin>powershell Set-ExecutionPolicy Unrestricted
C:\Program Files\DataStax Community\apache-cassandra\bin>cassandra
Detected powershell execution permissions. Running with enhanced startup scripts.
This following statement comes in red colour
The term '/' is not recognized as a cmdlet, function, operable program, or
script file. Verify the term and try again.
At line:1 char:2
+ /f <<<< ile C:\Program Files\DataStax Community\apache-cassandra\\bin\cassandra.ps1
If it's still not clear I attached an image:
I am studding Cassandra and I had the same issue. Follow the steps below to start it. I hope it help you.
1 - To open windows variables editor:
2 - Add the following variables according to your Java physical path (64 bits), Cassandra physical path and Java Memory Option. In my case:
JAVA_HOME = C:\Program Files\Java\jre1.8.0_221
CASSANDRA_HOME = C:\Program Files (x86)\apache-cassandra-3.11.4
_JAVA_OPTIONS = -Xmx2048‬M
3 - To open your powershell as administrator
4 - Access your Cassandra folder:
5 - Execute the command ".\cassandra" then your cassandra will start.
Powershell permissions
As the error states, you need to grant Powershell permissions to the Windows account running the Cassandra script.
You can grant permissions to all Windows accounts on your machine with:
C:\> powershell Set-ExecutionPolicy Unrestricted
WARNING: You need to run the command prompt as an administrator for the command above to work.
As an alternative, you can grant unrestricted access just for your current user with:
C:\> powershell Set-ExecutionPolicy -Scope CurrentUser Unrestricted
Heap size
As a side note, this error indicates that you don't have enough RAM on your machine to run Cassandra with the default configuration:
Error occurred during initialization of VM
Could not reserve enough space for object heap
My guess is that your laptop/desktop only has 8GB of RAM. By default, Cassandra will attempt to start with 2GB of memory allocated to the heap but if there isn't enough free memory, Java will fail to reserve it.
Try to start Cassandra with a more conservative allocation of 1GB for max heap size and 400MB for NewGen by uncommenting the following lines in the "Heap Settings" section of conf/jvm.options:
-Xms1G
-Xmx1G
-Xmn400M
Windows support
I wanted to let you know that there is very limited Windows support in Cassandra 3.11 and there are several known issues that will not be fixed due to limitations in the operating system.
Furthermore, Windows support has been completely dropped in Cassandra 4.0 due to lack of maintainers and testing (CASSANDRA-16171).
As a workaround, we recommend the following:
Deploy Cassandra in Docker
Deploy Cassandra in a VM using software like VirtualBox
Deploy K8ssandra.io
If you just want to build apps with Cassandra as a backend, Astra DB has a free tier that lets you launch a Cassandra cluster in a few clicks with no credit card required. Cheers!

disk I/O error with SQLite

I have a (tiny) dynamic website that is (roughly) a Perl CGI script using a SQLite database. Package DBI is the abstraction layer used in Perl.
About one week ago, I started to see this error message:
disk I/O error(10) at dbdimp.c line 271
Since this is a hosted site running Apache, I cannot see if the hard disk is (nearly) full. Access to command "df" is disabled.... but I used the (UNIX) shell command "yes > blah" to test the disk can still create new files. My database is very tiny -- less than 50 kilobytes.
I checked file and directory permissions: Directory and all parents are a+r,a+x (all + read/executable). The directory containing my SQLite database file is also a+w (all + write). The database file itself has a+w,a+r (all + read/write).
I wrote a simple Perl program to test I can run the failing select query: It runs fine.
I ran query "VACUUM" on the database. I tried my tests again -- no improvement.
I dumped the SQLite database to raw SQL (using SQLite shell command ".dump") and rebuilt. I tried my tests again -- no improvement.
Any suggestions? I am so confused... Normally, the above list can catch most programming/setup errors.
Another cause for this:
Database file is writeable
Database journal file (ending in -journal) is not writable
When the database file isn't writable, you get a "readonly database" error. When it's writable, but the journal file is not, you get "I/O error" instead.
Unfortunately, sqlite3.h isn't very descriptive about what the specific issue is. Error code 10 is defined here:
#define SQLITE_IOERR 10 /* Some kind of disk I/O error occurred */
You may have an issue with /tmp being full at certain points or sqlite not having access to memory to write its page cache. This is unlikely though if your db is 50kb as sqlite should be able to hold your page cache in memory.
You could try making a copy of the db in the hopes that sqlite can read the copied database and update your code to reflect that:
$sqlite3 your.db
sqlite> begin immediate;
<press CTRL+Z>
$cp your.db copyofyour.db
$exit
sqlite> rollback;
You should also check the logs to see if this is happening with every request or intermittently. You may want to see if you have access to other commands to monitor server health (top, free). Being able to reproduce the issue seems to be your first task at hand. If you can't reproduce it with consistently, it's likely a memory related issue.
A possible, and maybe hard to detect, error source may be if file locking fails. You could test if your file system currently supports file locking with
flock testfile touch testfile
NFS file systems for example may exhibit this behavior depending on NFS server configuration.