Moved Servers, File Downloads Not Working?

4 replies [Last post]
brw
User offline. Last seen 4 weeks 6 days ago. Offline
Joined: 04/15/2010

Hey Leighton,

Since moving servers and a couple of directories around last week, our file downloads aren't working. They were definitely working before the server change. I've tested lots of different ways of doing this over the past several hours, but still can't seem to get it to work. It appears that it's not able to read a certain directory (more on that later), though I'm not sure why... Here's how everything is configured:

- /var/www/domain.com/downloads
- /var/www/domain.com/downloads/ms_files
- /var/www/domain.com/downloads/FileToDownload.pdf
- /var/www/domain.com/downloads/ms_files/FileToDownload.pdf
--- chmod -R 777 on each of these folders and files above.

- /admin/settings/file-system
--- File System Path: /var/www/domain.com/downloads
--- Temporary Directory: /var/www/domain.com/tmp (Note: I've also tried making this /var/www/domain.com/downloads )
--- Download Method: Private
--- (Note: Our webroot is /var/www/domain.com/www )

- /admin/moneyscripts/ms_files
--- [Checked] Generate New Download Link Each Time
--- Advanced Settings > Existing Files Search Path: [Blank], I have also tried making this /var/www/domain.com/downloads.

- /admin/build/ms_files/edit/1
--- File Settings > Current File : the filename shows up properly.
--- Choose New File > Select an Existing File : the files in the directory show up properly in the dropdown.

--------------------
Now, the buggy part:

- /admin/build/ms_files/edit/1
--- Choose New File > Choose File : I choose a file to upload, it goes through the process, then displays the following two lines on the confirmation page:
----- The directory is not accessible
----- PayPal File Saved: [File Display Name].

What I find weird about this is that when I look through the module's the code, it looks like it could either be in row 1896 or 1948. It also looks like it should be displaying a directory path between "directory" and "is" in the error display.

Do you know what could be causing this? I'm imagining that this is related to the fundamental problem on this end. Like I said, I've checked file and directory permissions, database entries, etc. Everything I know to look at, I've looked at and it seems like it should be working. I have tried everything I can think of, including creating a new file download product, entering all directory paths explicitly, deleting files and reuploading them via SCP, uploading new files, changing download directories, etc, and nothing seems to work.

Thoughts?

Ben

brw
User offline. Last seen 4 weeks 6 days ago. Offline
Joined: 04/15/2010
Hey Leighton, It looks like

Hey Leighton,

It looks like something also went terribly wrong in my watchdog table that relates to this. I'm looking into it now, but I had, literally, over 30,000,000 entries in watchdog. I deleted all but 1000 of them so I could work in there, but the ones that are left look like most of them are one of the following:

a:4:{s:6:"%error";s:7:"warning";s:8:"%message";s:57:"fread() expects parameter 1 to be resource, boolean given";s:5:"%file";s:79:"/var/www/domain.com/www/sites/all/modules/moneyscripts/ms_files/ms_files.module";s:5:"%line";i:590;}

a:4:{s:6:"%error";s:7:"warning";s:8:"%message";s:56:"feof() expects parameter 1 to be resource, boolean given";s:5:"%file";s:79:"/var/www/domain.com/www/sites/all/modules/moneyscripts/ms_files/ms_files.module";s:5:"%line";i:588;}

Not sure if that helps or not. I looked at the file and just don't understand the module well enough to know why it would be giving this error. :-/

wildkatana
User offline. Last seen 3 hours 55 min ago. Offline
Joined: 06/03/2009
Ben, Moving servers with

Ben,

Moving servers with drupal files is always a mess, I've been through some sticky situations myself. I suspect that the 'ms_files_default_directory' variable needs to be updated. One thing you can try doing is adding the following code to your ms_files.module file in the ms_files_cron() function, then running cron to execute it.

$dir = file_directory_path() .'/ms_files';
variable_set('ms_files_default_directory', $dir);

That will update the variable, and may fix the problem.

Sincerely,

Leighton Whiting

brw
User offline. Last seen 4 weeks 6 days ago. Offline
Joined: 04/15/2010
Hey Leighton, That

Hey Leighton,

That works!

Always appreciate your fantastic level of service.

Thanks again,

Ben

wildkatana
User offline. Last seen 3 hours 55 min ago. Offline
Joined: 06/03/2009
Ben, Glad to hear it

Ben,
Glad to hear it :)

Sincerely,
Leighton Whiting