1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.4 some avatars are broken images

Discussion in 'Troubleshooting and Problems' started by xmlxp, Jun 10, 2016.

  1. xmlxp

    xmlxp Active Member

    Hi All

    I moved my forums backup to a new server and after restoring I found some (not all) members avatars are broken images. data and internal_data folders permissions are 777

    Before I move I upgraded mysql to MariaDB then I checked every thing including avatars and every thing is working fine on the old server then I made a backup then moved it to the new server
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    Do the images exist on the new server?
    It's possible the restore is incomplete.

    If they do exist, then it could point to permission (chmod) or ownership (chown) issues.
     
  3. xmlxp

    xmlxp Active Member

    This is the out come when I request the url of the broken avatar
    Not Found
    The requested URL /community/data/avatars/s/77/77556.jpg was not found on this server.

    How its possible the restore was incomplete? I didn't receive any error message during the restoration process !
     
  4. xmlxp

    xmlxp Active Member

    I checked the database sizes on both servers.
    On the old server its 4.6 GB
    On the new server its 4.5 GB

    What could cause incomplete restore? is there any settings I should do on the new server to make sure the restore is complete?
     
  5. Mike

    Mike XenForo Developer Staff Member

    This relates to the file system rather than the database. I don't think we could really comment what would cause this as it would depend on the method you used to transfer everything.
     
  6. xmlxp

    xmlxp Active Member

    Hello Mike

    you mean avatars are not included in backups? if yes then the problem is solved
     
  7. Mike

    Mike XenForo Developer Staff Member

    What do you mean by "backups"? You need to backup the database and the file system (by default, that would be the directory containing XenForo). If you don't backup the files, you won't have attachments, avatars and other data.
     
    xmlxp likes this.
  8. xmlxp

    xmlxp Active Member

    This time I made a backup for the whole user account which includes database and all folders and files of the root directory and restored it to the new server here is one of the broken avatars:

    Not Found
    The requested URL /community/data/avatars/s/55/55255.jpg was not found on this server.

    when I searched for that avatars 55255.jpg in FTP I foundout it exist but have permission of 666 !

    BA.png

    I tried to change the permission to 777 but it says
    Response: 550 Could not change perms on 55255.jpg: Operation not permitted !

    How to fix this?
     
  9. Brogan

    Brogan XenForo Moderator Staff Member

    Try chown'ing first.
     
  10. xmlxp

    xmlxp Active Member

    I did
    chmod -R 777 data
    chmod -R 777 internal_data

    But still not fix
     
  11. xmlxp

    xmlxp Active Member

    I did
    chown -R vbcom:vbcom /home/vbcom/public_html/
    chown -R vbcom:nobody /home/vbcom/public_html/

    and that fixed the problem
     
  12. Tracy Perry

    Tracy Perry Well-Known Member

    Yeah, chown requires a user:group to work. ;)
     
  13. xmlxp

    xmlxp Active Member

    I am having now a broken thumnails attachments (but the full image attachments is ok) and I have to chown to fix the broken thumnails attachments that are already posted but the problem keep happening again and again with every new thumnails attachments when posted and I have to chown again and again to fix the problem!!

    I am running xf143, Centos 7, Apache2.4, MariaDB 10
     
    Last edited: Jun 11, 2016
  14. Tracy Perry

    Tracy Perry Well-Known Member

    Sounds more like a hosting issue. Something is changing ownership of the files at some time.
    Are you using anything like selinux? Are you managing this server or do you have someone else doing it?
     
  15. xmlxp

    xmlxp Active Member

    Hello Tracy

    yes SElinux is installed but its also installed in my old server Centos 6 and never caused a problem. Yes I have root access to the server

    Edit: SELinux status: disabled
     
    Last edited: Jun 11, 2016
  16. xmlxp

    xmlxp Active Member

    another issue in the server error log:
    ErrorException: fopen(/home/vbcom/public_html/community/internal_data/sitemaps/sitemap-1465647229-7.xml): failed to open stream: Permission denied - library/XenForo/Deferred/Sitemap.php:210
     
  17. Tracy Perry

    Tracy Perry Well-Known Member

    You say you are using CentOS, MariaDB and Apache 2.4. I'm going to assume since you are using Apache and not nginx, OLS or LiteSpeed you are using a cPanel setup?
    And what user/group is 99? It looks like nobody:nobody on my CentOS box.
     
  18. xmlxp

    xmlxp Active Member

    if you mean the xenforo root directory and all sub-directories inside it then its user:nobody
     
  19. Tracy Perry

    Tracy Perry Well-Known Member

    If you look at your image, that file you highlighted was changed to nobody:nobody as the owner. Either you have script (cron) running that does that or your PHP processor changes it (and if it keeps redoing the same ones, it's a server issue).
    if nothing else, you can set up a script to run in a cron to reset the ownership every few hours - but that's only a band-aid solution. You need to find out what on y our server is changing the ownership.
    You could use audit to check what is changing the files possibly
    https://www.digitalocean.com/community/tutorials/how-to-use-the-linux-auditing-system-on-centos-7
     
  20. xmlxp

    xmlxp Active Member

    when I do
    chown user:user /home/user/public_html
    my forums broken and I get this message:
    Forbidden
    You don't have permission to access /community/ on this server.
    Server unable to read htaccess file, denying access to be safe
    Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

    I am using the default htaccess out of the box of xenforo package !!
     
    Last edited: Jun 12, 2016

Share This Page