Unable to change Image Path
- FOG Version: 1.4.3
- OS: Ubuntu Server 16.10
- Service Version: N/A
- OS: N/A
I’m trying to cleanup our image names and paths a bit. When trying to change the image path for a particular image I receive the error “Please choose a different path, this one is already in use by another image.” We only have seven images on this FOG server and I’ve verified with all other images that this path is not being used by any of the others. I’ve done this same process for several other images without any issues.
I thought perhaps there might be an image that got orphaned in the images table. Running the query “select imagePath from images;” returns a list of all image paths, none of which match the path I’m trying to change this image to. The number of returned rows also matches the number of images we currently have visible in the GUI as well, so no orphaned image definitions.
Any other ideas on what might be going on here and how I can get this image path changed? I supposed I could update directly in the database, but thought I’d check here before I went that route.
That did the trick, thanks!
Mind trying this?
wget -O /var/www/fog/lib/pages/imagemanagementpage.class.php https://raw.githubusercontent.com/FOGProject/fogproject/0d1f0899460b40b069eeb17df1cb9fdd1f081e10/packages/web/lib/pages/imagemanagementpage.class.php
It should fix the issue you are seeing.
Here you can see I’ve changed the folder name at the file system level:
And here you can see that there are no other images in the database using that path:
@aparker Schema updates don’t always happen, we just don’t know when they will which is why that message is present on the installer.
Can you show a picture of the error you’re seeing? I’m unable to replicate the problem on my side.
How am I testing:
Open Images, find an image, edit the image path and save. Goto another page, hard refresh, go back to the same image and look at the setting. (The other page, hard refresh is to ensure the browser isn’t caching past information). The setting remains.
Finally got a chance to give this a go. Upgraded to 1.4.4, but with no change–I’m still unable to save the image with the new image path.
On a perhaps related note, I never did get prompted to update the database when I navigated to http://<IPAddress>/fog/management as instructed by the installer. Not sure if this is expected behavior with this release, but that’s the first time I’ve seen that.
@Tom-Elliott Shouldn’t be a problem, I’ll update by end of the day today.
@aparker Can you update to 1.4.4, I believe I saw this issue and fixed it between these releases. (It happened rather quickly so I may have missed it in the commits list. If it’s still not fixed, that’s okay I know what to do to fix it anyway).
Let me clarify further. I’m aware of the process you’ve outlined here, but that’s not what I’m trying to do. We’re not moving our /images folder, I’m just trying to rename a folder for an image that’s in our /images folder. I’ll walk through exactly what I’m doing:
1.) Rename folder in /images in the OS. In this case I’m renaming “/images/Lenovo_T450” to “/images/Lenovo_T450_W10ENT” .
2.) Log into the FOG web GUI and browse to Image Management–>List All Images–>(Image indicated above).
3.) Change the Image Path field from “Lenovo_T450” to “Lenovo_T450_W10ENT”. Click Update.
4.) After clicking update, I get the error message “Please choose a different path, this one is already in use by another image.”
My point is that that image path is not in use by another image. I’ve verified that with the SQL query I mentioned in my original post. The web GUI seems to think that image path is already in use though.
@aparker Oh, ok. We need to back up. So, changes in the GUI for certain things don’t actually change the settings that need changed in the OS. So if you wanted to change the image path, you’d need to make those paths first in the OS manually.
For example, let’s say you wanted your new path to be
/newimagesthe structure would look like this:
Make those files with the touch command, like
Next, for the images to actually be in the new path, you’d have to move them over. In this example, the command would be this:
mv /images/* /newimages
Permissions should be set as 777 recursively:
chmod -R 777 /newimages
Ownership should be set to fog:root
chown -R fog:root /newimages
More information on that stuff:
Next, you’d need to modify
/etc/exportsto reflect the new (or additional) paths.
Then, when you make those changes to a node in the GUI, they will work.
@Wayne-Workman I’m sorry, I’m not sure I’m following. Which command? I’m trying to change the path via the GUI. The SQL query I ran to verify the path didn’t already exist was “Select imagePath from images”.
We would need to see the command you’re using.