-
Notifications
You must be signed in to change notification settings - Fork 393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failing to keep a dynamic.css file in sync #47
Comments
When I force a copy I see this error. Warning: copy(s3://foxtrotcode-media.s3.amazonaws.com/uploads/custom_styles/dynamic.css): failed to open stream: "S3_Uploads_Stream_Wrapper::stream_open" call failed in /opt/bitnami/apps/wordpress/htdocs/wp-content/plugins/S3-Uploads-master/inc/class-s3-uploads-wp-cli-command.php on line 405 The "Success:" was also was incorrect, it failed. |
@Grendel61 it looks like your |
That worked as a fix on the copy, sorry about that. What's your thought on the dynamic CSS problem? |
It is actually somewhat stranger, now that I investigated it more deeply. I don't think the file dynamic.css is even getting recreated. It has a time stamp from many days ago when I first installed the upgrade to this theme. It actually seems to just vanish from the S3, whenever anything is saved on the backend admin interface. I have to use the cp command to move it back into S3. Thoughts? |
@Grendel61 what you explained should be working ok - is this is particular plugin or piece of code you could share? Thanks |
It's not code I wrote, but for some reason every time I save any settings on the admin interface, the directory that holds this CSS is deleted by Upload-S3, and I have to CP the directory and file again to restore the CSS. Is there anyway to override Upload-S3 redirecting the path for this single file? Or is there a way to ensure that this directory isn't accidentally deleted? I'm not sure what is happening, but I think it has to be Upload-S3 deleting this directory. This directory is in the Uploads directory, and I'm trying to sync all the contents of the Upload directory to S3. In this case there seems to be a problem. |
So Joe, Just trying to isolate this problem so we can fix it.
Do you have any thoughts on this? |
I think I may have found the problem. It's probably beyond Upload-S3 to fix this. I've got multiple versions of the Wordpress App on different servers writing to the same S3 buckets. Normally they would be unlikely to have a conflict, because the S3 buckets mainly have image files that rarely get updated simultaneously. However, in this one case if I had two instances changing the admin panel, they would both try to write out to this one dynamic.css potentially. That would probably confuse Upload-S3 regarding the timestamps. Possibly one instance could lock the file which could be the "exclusive locks" error, and then the other instance couldn't write out to it. This leads me to a question. The css file in question is in a directory called custom_styles by itself and it is called dynamic.css. Can you configure the Upload-S3 "--sync" command to ignore a directory? Is there a place where I could hack that. This file and directory should probably stay local. |
The theme I'm using creates a dynamic CSS directory within uploads, and then generates a CSS based on various updates of settings and other hooks. When the CSS is generated the directory must be deleted and then recreated. S3-Uploads deletes the file and directory from S3, but then doesn't recreate it. However, S3-uploads must not be detecting the file being re-created. The result is that the browser looks for a directory and a CSS file that it can't find, and returns a 403.
It seems like the detection of the deletion occurs, because the directory and the file are deleted from S3. However, the re-creation of the file goes undetected, so the new directory and file aren't uploaded to S3.
Thoughts?
The text was updated successfully, but these errors were encountered: