Git Commit hanging

Wappler Version : 2.1.2
Operating System : Windows 10

Expected behavior

Files should upload to repository

Actual behavior

Trying to upload a quite big site to a git repository using new git feature (smaller sites have worked correctly)
(site is hosted on local network server, not on local machine)

Site has 3295 files

I select all files, add a title and click Commit

I get the “committing changes” message and can see initially network activity indicating files are being committed
After about 2mins 30s network activity ceases (complete?) but the “committing changes” message continues and never stops (i have left it overnight so still busy 8 hrs later)
Wappler cannot be exited by normal means due to modal message and has to be quit out from task bar or task manager
The repository is not created

Video showing issue and network activity and a debug log attached

git problem.mp4 (7.0 MB)

chrome_debug.zip (4.2 KB)

Debug log seems to contain little more than

*“Uncaught (in promise) Error: UNKNOWN: unknown error, watch”, source: internal/fs/watchers.js *

error messages

hmm seems we have some troubles with your paths, I see also error like:
Uncaught (in promise) Error: invalid path: 'roomimages/album-721576949550264601.'"

could you tell a bit more about your folder structure? I see many images with special paths?
Maybe not all of them have valid path names?

Using your example

the roomimages folder contains, not surprisingly, images of rooms within accommodation blocks

the structure is /roomimages/{{buidingid}}

within that is the roomid

/roomimages/{{buidingid}}/{{roomid}}

image

This contains the large images and subfolders of the mid size and thumbnails

My local copy does not contain all the online images as they are uploaded by the customer via an admin panel. I assume the git feature only backs up the local files, not the online files?

While i can not vouch for what the the file names are, they are all images, not galleries although some of the file names may lead you to think otherwise, they are replications of the names given on the accommodation blocks own website from where they are taken

Spotted the file in that error message, just one file with no extension

image

Well you should check if the file names are really valid. Do they have right extensions? Maybe invalid characters in the name?

Check the file in the error I mentioned.

Aha that might be the problem.

Btw in cases with many customer uploaded images you should either clear the file names really well or just generate unique guid as image file name

Yes, this was an early section of the project when i was still very much in the learning zone (still am :wink:), many things i would have done differently if i was to be doing it now.

So basically is a file lacks a valid extension, git commit will fail?

Not a problem as long as I know that.

Will delete the file and try commit again

@patrick will add more checks for invalid file names and the commit errors. Those should be at least made visible

1 Like

Put a hold on that, seem to have some sort of integrity error with that file, it wont delete or rename. will come back to you when resolved. Thanks for sharing your Saturday morning with me!

1 Like

Removing that 1 file seems to have resolved the problem!

Site committed to git successfully

I can only assume that the commit process was hanging due to the empty file extension (which also confused the hell of out windows I may add)

Btw just an advice: although it is possible, it might be not very good idea to have all user generated files into your local repository as backup. It will just make it too large and slow it down.

Also those images keep getting updated online, just as you database get mutated.

So I would suggest different backup strategy for online images and database.

So you can just add the images folder to .gitignore and keep your repository for code change history.

Yes, sensible. I actually have no need for any of the images locally at all, there was just a small subset i had downloaded for testing purposes. Server is backed up daily anyway
Was really just trying out the git feature at this stage, just my luck to have a dodgy filename!
I will set them to be ignored, good advice

Thanks again for your time, especially at the weekend.

1 Like