Missing Original after attempting to rotate or write metadata | Gallery Server Support | Forum 2017-04-03T08:11:21+00:00

**Attention** Our offices are closed Mar 25 РApril 2, 2017. Any forum posts requiring our support will be answered after April 2. Sorry for any inconvenience.

Avatar
Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

Lost password?
sp_Feed gs-icon-32x32
Missing Original after attempting to rotate or write metadata
Avatar
chris.driscoll
Member
Members
Forum Posts: 4
Member Since:
November 16, 2017
sp_UserOfflineSmall Offline
1
December 31, 2017 - 1:37 pm
sp_Permalink sp_Print

In the attached example I attempted to rotate a jpg file 90 degrees through the application. I received an error and in checking the event log it states “Error: Cannot create a file when that file already exists.” I monitored the file in windows explorer both prior to attempting the rotation and after. The original file existed prior to attempting to rotate but has disappeared after the error.

I have seen similar situations when adding captions and tags then attempting to write back to the original file. I am a new consumer of GS so I assume it is a system setting or time out variable that needs to be tweaked. I would appreciate any help as this is a very valuable tool I would like to continue to use but I do not want to continue to lose the originals I have on the webserver (Yes I have them backed up).

The event log of the rotation and resulting error is attached.Thanks in advance for the support.

Avatar
Admin
Admin
Forum Posts: 5
Member Since:
September 8, 2014
sp_UserOfflineSmall Offline
2
January 2, 2018 - 1:27 pm
sp_Permalink sp_Print

When rotating an image, Gallery Server executes a few steps: creates a new, rotated image, copies the metadata from the old image to the new image, deletes the original, and moves the rotated image to the same directory and name as the original. For some reason, the function to replace the file is failing to delete the original before attempting to move the new image in its place. However, since you noticed the original actually does disappear, it is possible that the OS is not *finished* deleting the original by the time it attempts to move the new file into its place.

Gallery Server has used this technique for years and this is the first time there’s been a reported issue with it. I reviewed the code and it seems rock solid. I’m stumped so I posted a question to Stack Overflow to see if anyone has any ideas. In the short time since I posted the question, two possibilities have emerged:

1) Two web browsers (or tabs) are altering the file at the exact same time, causing a race condition where one wins and the other gets this error.

2) Antivirus software

If you have antivirus software, try disabling it to see if it has an effect.

Avatar
chris.driscoll
Member
Members
Forum Posts: 4
Member Since:
November 16, 2017
sp_UserOfflineSmall Offline
3
January 2, 2018 - 5:49 pm
sp_Permalink sp_Print

Thank you for the follow up Roger. I did not mean in anyway to imply there is an issue with the code. I believe this is more likely a user configurable setting or permission that I have overlooked on the server.

First to reply to your suggestions:

1) Only 3 users have access to the administrative section of the site. I have confirmed I am the only one making changes and I only have one tab open.

2) I disabled all antivirus, and the windows built in protection (SmartScreen and UAC).

I rotated and image successfully 90 degrees. I then tried to rotate the image back to its original position and the original was deleted.

I do have a question. Where is the new rotated image created? Should I check in that directory to see if the new image appears?

Avatar
Admin
Admin
Forum Posts: 5
Member Since:
September 8, 2014
sp_UserOfflineSmall Offline
4
January 4, 2018 - 10:53 am
sp_Permalink sp_Print

The rotated image is created in the App_Data\_Temp directory with a GUID for its name like this:

C:\inetpub\wwwroot\App_Data\_Temp\c3f28e143b3c45a29e962b173235d004.tmp

Once it is created, Gallery Server deletes the original and moves the temp file into the original location, renaming it in the process to match the original file.

Based on what I’m seeing in the StackOverflow thread, I think we need to update that function to include retry logic if it fails. Hopefully whatever is happening in your case is transient and will succeed if we just retry it in, say, 200 ms.

We are getting ready to release 4.4.1 and I will work to include this change in the release.

Avatar
chris.driscoll
Member
Members
Forum Posts: 4
Member Since:
November 16, 2017
sp_UserOfflineSmall Offline
5
January 6, 2018 - 8:50 pm
sp_Permalink sp_Print

Thank you for the follow up. I look forward to trying the new release. If there is any testing I can do to help you prior to the release please let me know.

Avatar
Roger Martin
Admin
Forum Posts: 5362
Member Since:
August 3, 2007
sp_UserOfflineSmall Offline
6
January 7, 2018 - 11:12 am
sp_Permalink sp_Print

4.4.1 is now released, so go ahead and give it a try. Read the blog announcement here.

Roger Martin
Founder and Lead Developer of Gallery Server

Avatar
chris.driscoll
Member
Members
Forum Posts: 4
Member Since:
November 16, 2017
sp_UserOfflineSmall Offline
7
January 8, 2018 - 12:49 pm
sp_Permalink sp_Print

Thanks the problem does not seem to be occurring in 4.4.1 with my initial testing. I will keep an eye on it but I believe this one is resolved. Thanks again for your help.

Forum Timezone: America/Denver

Most Users Ever Online: 134

Currently Online:
1 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Guest: 794

sam: 186

JKay: 140

chrisdoan: 118

iamjwk: 99

meigs: 86

paul.currens: 83

DNR_Media: 77

rmcbride@rama.com: 74

jhill8: 72

Newest Members:

mytv kargutkar

Wayne Harris

Edward Clifton

Max thomas

Gerry Tan

Backlinks One BeingDigi

Berger Michael

Sergey Sentsev

Gobinda Paul

TJ Lynch

Forum Stats:

Groups: 1

Forums: 31

Topics: 3010

Posts: 13511

 

Member Stats:

Guest Posters: 0

Members: 5768

Moderators: 0

Admins: 2

Administrators: Admin, Roger Martin