Koozali.org: home of the SME Server

Random file permissions changing occasionally.

Offline Agent86

  • *****
  • 592
  • +0/-0
    • http://www.iclbiz.com
Random file permissions changing occasionally.
« on: November 25, 2008, 02:21:30 PM »
Hi

Using SME 7.2

I've noticed recently that on occasion I get a permission error on my webserver.

I'm hosting my own images on ebay inside of an ibay which has been working perfectly for a couple years now.

I've noticed an increase of file permission errors such as: (you do not have permissions to access this server) this is the browser message when trying to view the image.

It would appear that the image file gets saved to the ibay with wrong permissions for (User=Read,Write) (Group=Write) and thats all. Sometimes it's a little different then that.
It should be (User=Read,Write,Execute) (Group=Read,Write) and (Other=Read) or something similar.
Anyhow I can login as admin and manually set the permissions for these files when this occurs.And it's only occasionally.?
Could it be the program I'm using to to create the web album or something ? Or is this a server issue. I don't know where to start to diagnose this subject.

How would I find out why or how this could be happening. ?
Is there a particular log I could review to try and determine this ?

I basically login to the local server with Smb4K on the desktop computers, and just mount the ibay to the desktop. And it's worked fine for years.
I upload my pictures from the camera etc. and do my ebay listings.
I don't know why it could , or how permissions could get changed but it seems to be happening more frequently, but still only sometimes and only on a file or 2, not all the camera files are doing that, just a couple at a time.

For example: if I upload 10 images, then I create my web album lets say all images work great, but then 1 or 2 of those images are not accessible via the web because of permission topic.
I then manually change the permission for those 2 files and it works again.

Any help in investigating this. I'm not really sure where to start looking.
Thanks
« Last Edit: November 25, 2008, 06:51:08 PM by Agent86 »

Offline gzartman

  • *
  • 306
  • +0/-0
    • LEI Engineering & Surveying
Re: Random file permissions changing occasionally.
« Reply #1 on: November 26, 2008, 01:38:58 AM »
File permissions do not change randomly.  You are either:

A.  Uploading files in such a way that you are forcing permissions/ownership on them that conflicts with defined ibay permissions/ownership; or

B.  Accessing the files in such a way that you do not have access to view them. 

There are some troubleshooting things you could do to see what permissions are actually being assigned to your files, but I believe this is a waste of time.  I am pretty sure your problem has to do with bullet A above.

The simplest solution to ensure the files you upload to an ibay have the correct ownership and permissions is to do the following after you upload your files:

 1. Access the server-manager for your SME Server.

 2. Click the Ibays menu option.

 3. Find the ibay that you are uploading files to and click the "Modify" link. This will bring up the ibay configuration details.

 4. Click the Save button.

This will reset the permissions/ownership of all files in this ibay the defaults for this ibays. 

The entire procedure shouldn't take you more than 2 minutes to complete and will ensure your permissions/ownership are set correctly for the files you've uploaded.
« Last Edit: November 26, 2008, 01:41:26 AM by gzartman »
----
Greg J. Zartman
LEI Engineering & Surveying

SME user and community member since 2000.

Offline Agent86

  • *****
  • 592
  • +0/-0
    • http://www.iclbiz.com
Re: Random file permissions changing occasionally.
« Reply #2 on: November 26, 2008, 04:01:16 AM »
Thanks for the info

Regarding:
Quote
A.  Uploading files in such a way that you are forcing permissions/ownership on them that conflicts with defined ibay permissions/ownership;

Can you give an example of how a person could upload a file that would force permissions/ownership. I mean if I grant group access to the ibay,and add users to that group which has write/read access and I've granted everyone read access, then everyone should always be able read images on that ibay.But I'm not sure how or why that would change all the sudden.

But I will save the ibay again and see how that goes as far as access.

But I'm worried something is going wrong with the server since this has been working for about 2 years up till now, and it's now getting worse.
I noticed today that almost all uploaded files are starting to have no permissions at all. The files seem to still allow me to access them normally via network shares but not when accessing the images through the internet. I  get permission error, and then I have to check the permissions and change them again. After I change them the images are accessible again via the net.

Offline gzartman

  • *
  • 306
  • +0/-0
    • LEI Engineering & Surveying
Re: Random file permissions changing occasionally.
« Reply #3 on: November 26, 2008, 04:12:31 AM »
Can you give an example of how a person could upload a file that would force permissions/ownership.

SFTP file upload.

I mean if I grant group access to the ibay,and add users to that group which has write/read access and I've granted everyone read access, then everyone should always be able read images on that ibay.But I'm not sure how or why that would change all the sudden.

Perhaps there is something more going on here than permissions.   Servers don't just change spontaneously "all of the sudden."  Something had to trigger this change in your servers behavior.  Backtrack to the time when you first noticed the change and try to figure out what changed: 

 - Did you install new software,
 - Did you make some custom changes,
 - Did you update your server?

You are going to need to provide more information about your setup, like what version of SME you are running.

I noticed today that almost all uploaded files are starting to have no permissions at all.

This is impossible.  What makes you think your files have no permissions?

Have you tried accessing your server via ssh (bash)?  Have a look at the ownership and permissions from you ssh session.
« Last Edit: November 26, 2008, 04:14:53 AM by gzartman »
----
Greg J. Zartman
LEI Engineering & Surveying

SME user and community member since 2000.

Offline Agent86

  • *****
  • 592
  • +0/-0
    • http://www.iclbiz.com
Re: Random file permissions changing occasionally.
« Reply #4 on: November 26, 2008, 11:27:02 PM »
Hi
Thanks for the info

Well, I am not sure if these changes could have effected this but in anycase I did follow the advice about going to the server-manager and modifying the ibay, but I just simply saved again without any modifications.
This appears to done something. I have uploaded a few images and they appear to be working fine thus far. I will post back if this changes.

As far as changes to the SME system, well recently I have have done the following:

  • The fetchmail got locked for one user due to bogus setting for remote mail.
  • So I had to edit the mysql database to remove the setting.I installed PHPMyAdmin to perform the mysql changes
  • Once that was fixed I had some trouble with the usb drive. I unplugged it thinking I could stop the backup job from occuring so that I could possibly restor to a time when the fetchmail was working. I ended up fixing the PHPMyadmin so then I tried to plug the usb drive backin and that was having some trouble, I had to fix the usb drive on another machine with gui, gparted etc. then I plugged the unit back in and it's working fine also.
  • I've since received disk array failure so I ordered a couple new drives and waiting for them to get here so I can upgrade the server etc.

I don't know if any of those items could have caused the permissions abnormality, but I'll post back if this continues to occur. But for now it appears fixed.

Thanks for the help on this. I really appreciate your time in advising me on this.
« Last Edit: November 26, 2008, 11:29:41 PM by Agent86 »

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: Random file permissions changing occasionally.
« Reply #5 on: November 27, 2008, 12:00:43 AM »

As far as changes to the SME system, well recently I have have done the following:

  • The fetchmail got locked for one user due to bogus setting for remote mail.
  • So I had to edit the mysql database to remove the setting.I installed PHPMyAdmin to perform the mysql changes

mysql has nothing to do with fetchmail, so I don't know what you are going on about here.

Quote
  • Once that was fixed I had some trouble with the usb drive. I unplugged it thinking I could stop the backup job from occuring so that I could possibly restor to a time when the fetchmail was working. I ended up fixing the PHPMyadmin so then I tried to plug the usb drive backin and that was having some trouble, I had to fix the usb drive on another machine with gui, gparted etc. then I plugged the unit back in and it's working fine also.
  • I've since received disk array failure so I ordered a couple new drives and waiting for them to get here so I can upgrade the server etc.

I don't know if any of those items could have caused the permissions abnormality, but I'll post back if this continues to occur. But for now it appears fixed.

No, those things have nothing to do with file permissions.

Offline Agent86

  • *****
  • 592
  • +0/-0
    • http://www.iclbiz.com
Re: Random file permissions changing occasionally.
« Reply #6 on: November 27, 2008, 03:04:22 PM »
CharlieBrady-

Thanks for the reply,
Nice to confirm this.
It was suggest that installing a program or something could cause a permission problem.
My response was to suggestions that something might cause this permission problem such as:
 - Did you install new software,
 - Did you make some custom changes,
 - Did you update your server?
And a suggestion that SFTP upload could cause a permission changes to be forced on the server ?

Since I was unaware of any such topics I posted what has been done to the server. I felt I needed to post what has been done since this was suggested as a possible cause.

Regarding fetchmail having nothing to do with mysql?
Perhaps this is true.I don't know if I am using the correct term.
Please see other post:http://forums.contribs.org/index.php/topic,42530.msg200738.html#msg200738in which people directed me to fix the fetchmail setting by going into the mysql data base for horde and fixing the data base and removing the settings which were causing the lockup.

I did as advised and the fetch mail was fixed. I'm don't disagree that mysql has nothing to do with fetch mail, however I'm confused about my solution for fetchmail which seems to direct me to fix mysql which solved the problem.And was advise to use mysqladmin to fix it?

Thanks for the input on this and it's good to know that none of my listed topics could have cause a permission problem.
I will try to pinpoint in other areas if this problem re-occurs
Thanks

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: Random file permissions changing occasionally.
« Reply #7 on: November 28, 2008, 12:53:00 AM »
Regarding fetchmail having nothing to do with mysql?
Perhaps this is true.I don't know if I am using the correct term.
Please see other post:http://forums.contribs.org/index.php/topic,42530.msg200738.html#msg200738in which people directed me to fix the fetchmail setting by going into the mysql data base for horde and fixing the data base and removing the settings which were causing the lockup.

I did as advised and the fetch mail was fixed. I'm don't disagree that mysql has nothing to do with fetch mail, however I'm confused about my solution for fetchmail which seems to direct me to fix mysql which solved the problem.And was advise to use mysqladmin to fix it?

That post refers to fetchmail_ settings in horde, and not to fetchmail, which is a different program.