exe4j fails unable creating temp directory (potentially causing Windows error 7) - exe4j

We use exe4j 4.4.4 to build an exe that runs our Java program. One of our customers is complaining that sometimes they are getting "Windows error 7" when running our exe. This only happens intermittently and only on a couple of machines out of hundreds.
We enabled exe4j debugging and noticed that in cases when we get the error exe4j log file contains several entries like the one below and then ends. However, on successful exe launch the log file goes beyond these entries and eventually launches our Java program.
These are the last several log messages in exe4j log file when we get the error:
GetTempPath returned 14 (last error 183)
make dir returned -1
tempPath is C:\WINNT\TEMP\
tempFile is C:\WINNT\TEMP\e4j38.tmp
Temp dir: C:\WINNT\TEMP\e4j38.tmp_dir
Could not create dir (183)
GetTempPath returned 14 (last error 183)
make dir returned -1
tempPath is C:\WINNT\TEMP\
tempFile is C:\WINNT\TEMP\e4j39.tmp
Temp dir: C:\WINNT\TEMP\e4j39.tmp_dir
Could not create dir (183)
GetTempPath returned 14 (last error 183)
make dir returned -1
tempPath is C:\WINNT\TEMP\
tempFile is C:\WINNT\TEMP\e4j3A.tmp
Temp dir: C:\WINNT\TEMP\e4j3A.tmp_dir
Could not create dir (183)

There was a bug in exe4j which caused it to cycle through its temp folders after a bunch application restarts. Exe4j reduced the chance for temp folder collisions in 4.4.5 version by adding a timestamp to the names of their temp folders.

Related

Icinga2 check_file_age always returns File not found

I'm using check_file_age command with service created in icinga2 director. It always returns file not found.
FILE_AGE CRITICAL: File not found - /root/last-backup
The file exists on the server and returns OK if ran in terminal.
~ '/usr/lib/nagios/plugins/check_file_age' '-c' '95000' '-f' '/root/last-backup' '-w' '90000'
FILE_AGE OK: /root/last-backup is 70052 seconds old and 11 bytes | age=70052s;90000;95000 size=11B;0;0;0
If I check the debug.log, the command returns exit code 2.
The problem is in permission, the agent is not able to access the file.
Move your file to different folder. Like /var/backups/last-backup.

MOVE Command in Batch Script: Moves with Errors

I'm working on part of a backup batch script that moves between two directories on the same drive. I was using Robocopy (with /MOVE switch), but want to speed up the file transfer. As such, I'm trying to implement MOVE. It has worked in one part of my script, but in my C: drive I am getting a weird error.
Here's a sample of a test script in a test folder, that comes up with the same error that I'm getting in the main batch (trying to isolate errors):
set thisdirectory=%cd%
cd ..
MOVE "%thisdirectory%" "C:\Documents\DEL\Stephen Company\"
I have tried that with/without the /Y switch, with all paths hard-coded (no vars), and with "\" added and removed from the end of the source/destination paths.
What happens is that the folder (thisdirectory) does indeed move, but the script won't continue to execute because I get this error:
C:\Documents\Active\Stephen Company>MOVE "C:\Documents\Active\Stephen Company\C123Stephen" "C:\Documents\DEL\Stephen Company\"
1 dir(s) moved.
The system cannot find the path specified.
I am an "Authenticated User" on this account, but not an Administrator.
If I run it in CMD Prompt without a batch script it works:
C:\Documents\Active\Stephen Company>MOVE "C123Stephen" "C:\Documents\Del\Stephen Company"
1 dir(s) moved.
This also works with full paths (not using the fact I'm 1 dir above to move it):
C:\Documents\Active\Stephen Company>MOVE "C:\Documents\Active\Stephen Company\C123Stephen" "C:\Documents\Del\Stephen Company"
1 dir(s) moved.
Any ideas how I'm messing this up? Thanks!!
NEW INFO: this may be obvious per the format of the error message I have posted to those (all?) of you with more CMD/Batch experience, but when I send the output of my MOVE command to a text file in the batch code above (> MoveOutput.txt) I only see "1 dir(s) moved". The error that is messing me up (The system cannot find the path specified) directly follows the execution of the MOVE command.
NOTE nothing follows the MOVE command in my script that I am getting the error in.

Powershell Keeps Resetting To Default Temp Folder

I am running a PowerShell script that extracts data from a database. However, I do not have enough space on the default %Appdata%Local/Temp/ folder. I know this because I get the error:
Exception calling "ExecuteNonQuery" with "0" argument(s): "Incorrect
key file for table
'C:\Windows\SERVIC~2\NETWOR~1\AppData\Local\Temp#sql7ec_3_3.MYI'; try
to repair it"
To fix this issue I am trying to change the Temp folder for PowerShell. I have changed it in regedit to:
TMP D:\Temp
Temp D:\Temp
In addition I run this code at the start of my script:
# Set Environmental Variables
[Environment]::SetEnvironmentVariable("TEMP", "D:\Temp\")
[Environment]::SetEnvironmentVariable("Temp", "D:\Temp\")
[Environment]::SetEnvironmentVariable("TMP", "D:\Temp\")
# Navigate to these temp folders
$TempDir = [System.IO.Path]::GetTempPath()
cd $TempDir # This actually returns 'D:\Temp\'
However, when the script runs I still get the error message:
Exception calling "ExecuteNonQuery" with "0" argument(s): "Incorrect
key file for table
'C:\Windows\SERVIC~2\NETWOR~1\AppData\Local\Temp#sql7ec_3_3.MYI'; try
to repair it"
Any advice on why it is defaulting to the %Appdata% folder and how to change it?
I found the solution, and it was to do with the Environmental Variables. I correctly changed the TEMP environment for PowerShell, however, since I called a DB it was the DB doing the actual calculation and using its own TEMP folder separate from PowerShell. When I changed the TEMP file location for the MySQL database it worked perfectly.

how to correct hresult error.ms sql server

when remotely accessing an instance, I try to open 'new query' in the sql server , it is given below error:
Error: already exists. (Exception from HRESULT: 0x80030050 (STG_E_FILEALREADYEXISTS))
How to correct this error?
actually, this error stems from a system bug.
When you open a new query, it is defined in the temp file.
The system cannot find the path specified in the temp file because there is no defined folder in the temp file.
To find the origin of the error, carry out following steps on the command prompt:
1) type the following:
echo %temp%
2)it gives the below path which temp files is saved.
C:\Users\username\AppData\Local\Temp\3
3) when we goes to the specified path to reach the temp file:
cd C:\Users\username\AppData\Local\Temp\3
it gives the error:
The system cannot find the path specified.
Solution: it should be created the specified file in the above path.

Cannot delete view-private file

In a dynamic ClearCase view on Windows 7, I've got a file with size 0 and name myproject.prj.$$$. I cannot open, delete, rename or modify that file. I'd prefer to delete the file, but when trying to delete it:
Windows Explorer shows the error message “Invalid MS-DOS function”.
cmd.exe’s del: “Incorrect function”.
ClearCase Explorer simply does nothing.
I've created a file with the same name at a different location, and was able to edit and delete that file without any issues - so I guess the file name is not the issue. The file first showed up after the computer had crashed. I'd prefer not to delete and recreate the view.
What can I do to delete this file?
It looks similar to "Delete of view private file fails with error: Cannot find the specified file":
Cause
The view-private file has been moved or deleted from the view storage within the .s directory.
The view database is still aware of the file and is out of sync with the source container.
Note: The most common reason of this occurrence is due to Virus Scanning. The Virus Scanner is configured to either move a file suspected of a virus to quarantine or is configured to delete the file.
Solution 1
Remove and recreate the view.
Solution 2
If removal of the view is not an option, then synchronize the view database and the source container
The Example below is quite complete, but the OP Martin mentions in the comments:
It was not necessary to run the commands:
The mvfs log already contained the name of the missing file several times.
After creating an empty file at the "view storage container path", the file in the view could be deleted.
Example
The view storage container 800011174be29f22Paul.txt of the file Paul.txt was deleted.
M:\niewandt_view5\rn-robin>mvfsstorage Paul.txt
C:\ccstg_c\views\niewandt_view5.vws\.s\00007\800011174be29f22Paul.txt
This is the expected result although the file is not there anymore.
Now we flush the mvfs cache:
M:\niewandt_view5\rn-robin>mvfscache -f mnode
And run the mvfsstorage command again:
M:\niewandt_view5\rn-robin>mvfsstorage Paul.txt
mvfsstorage: Error: Paul.txt - can't fetch cleartext
Now we have a problem to identify which storage container is missing.
Trying to open the file gives:
---------------------------
Editor
---------------------------
Invalid Function.
---------------------------
OK
---------------------------
If we try to delete the file, it is reporting:
---------------------------
Error deleting file or folder
---------------------------
Paul can not be deleted: Invalid MS-DOS function.
---------------------------
OK
---------------------------
To find the view storage container path for that file you need to look in the mvfs log.
The mvfs log is showing:
{89 pid/tid 139400000cf0/883b7838eb6b63d0} cleartext lookup view=niewandt_view5 vob=\rn-robin dbid=0x80001117 - No such file or directory
{90 pid/tid 139400000cf0/883b7838eb6b63d0} cleartext pname= \Device\HarddiskVolume1\ccstg_c\views\niewandt_view5.vws\.s\00007\800011174be29f22Paul.txt
The "\Device\HarddiskVolume1" location can be found on the view properties 'advanced' tab, "Host path" in ClearCase Explorer
I faced this problem recently in windows environment.
*
(Caution : proceed if you are okay to delete local view-private
file which is corrupted and no data of that file can be retrieved)
*
My case was similar to above and was getting the following errors -
1. Windows Explorer shows the error message “Invalid MS-DOS function”.
2. cmd.exe’s del: “Incorrect function”.
I found mvfs log path by typing mvfslog in command prompt and that would output following details
Log priority: error
irpops mask: 0x00000000
vops mask: 0x00000000
vfsops mask: 0x00000000
xops mask: 0x00000000
traps mask: 0x00000000
Kernel logfile: "C:\mvfslogs\20191205.log"
Now open the log file from above path
"C:\mvfslogs\20191205.log"
So if you have got incorrect function recently, then that would be the last data logged as error in above log file.
Opening the log file and observe at the end of file, it reads something similar to below-
line #(last-1) - mvfs: Error: ....da..da..da...da... - No such file or directory
line #(last) - mvfs: Error: ....da...da...da...da... \your_container_location\..da..\..da..\..da..your_view_name.vws\.s\00037\800001765bf06476cc3080a
So that last word in above path(800001765bf06476cc3080a) is you actual file reference of your file in your_container_location. (Some times it might read as 800001765bf06476cc3080ayour_file_name.extension).
So now what is happening is
it is looking for your file reference 800001765bf06476cc3080a in
your_container_location path
(\your_container_location..da....da....da..your_view_name.vws.s\00037)
but it is not found(As data is not synchronized between your local
view and your_container_location).
So now all is required is
Step 1-to create a file named as 800001765bf06476cc3080a (as per your file name) in \your_container_location\..da..\..da..\..da..your_view_name.vws\.s\00037
Step 2-refresh your local view.
Step 3-Delete the file.
Now that the file should be able to delete permanently. And you can reuse your view.

Resources