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
No download link for some products #19591
Comments
Hi, I can see in the
It doesn't sound like you've ruled these out yet? My thinking is something (such as those extensions) is err'ing when downloads are regenerated and thus blocking their creation. WC > System Status > Logs, specifically fatal error log, may give clues. Other than that, have you seen if removing the download expiry helps at all? Have you checked the These are a few things you should investigate to identify the problem. On a clean install I'm not having problems with download regeneration so I'm not able to replicate this issue or confirm there is a problem within WooCommerce itself. I'd encourage you to check the points listed above and get back to us if you find anything odd, or contact the helpdesk if you need help from someone and want to share logins. https://woocommerce.com/contact-us/ Thanks |
Thank you for your answer. So I checked everything you mentioned. I turned off all extensions, I deleted limits for download and tried to regenerate but nothing happened. I checked |
The regenerate button should loop over all items in the order add add records into |
Damn, I disabled all plugins and re-uploaded file and made order again with the same result. I made order for other files and link is ok. Mystery. No errors in logs :( I updated permission for files on server and added all rights to the database user. I will get back to this tomorrow. Anyway, thanks for your help. If you will get any idea what I can check or do let me know. If in the future I will find "my bug" I will update this thread for other people. Thanks! |
One question before I go to bed and think all night what the hell I did wrong :) |
It just runs a function in the backend then displays a notice saying it was done. Rows would appear in the DB table if it worked. |
Hi guys, I'm getting the same issue on a multi-site install. Similar to @AprilONeil, we've disabled all other plugins except for WooCommerce, we are on the latest WooCommerce (3.3.5) and have also reverted to the default theme. The rows into the Clicking 'Regenerate download permissions' simply refreshes the edit order page and says 'order updated', but the Using the 'Downloadable Product Permissions' controls and clicking 'Grant Access' after selecting an appropriate product yields a 'Could not grant access - the user may already have permission for this file or billing email is not set. Ensure the billing email is set, and the order has been saved' error. Checked logs on local and on Pressidium (where this site is hosted) nothing at the time the above actions take place. I have a feeling this has something to do with multi-site table names though. Problem exists on production and local environments, I'll have the other dev copy in the exact details of the setup if you need. |
Uhh. I am still trying to find where the issue is. I checked file permission on server. I tried to upload new one to the different folder and there is access to the files but still nothing. Most annoying is that this doesn't work randomly. The size of file and upload date is also random. No database errors in logs, same for nginx, php fpm log. Still no luck in my investigation. |
Hi Guys, After a deep investigation of this issue, we've come to the conclusion the problem is caused when the filename of the Downloadable file(s) is rather big. For example, I have added those two files as a test (http://prntscr.com/j9f57u) and I can see them normally in my account's order as well as on the administrative side of the order (https://prnt.sc/ja9bm7). However, once the filename is larger it fails not showing in my accounts, on the administrative side of the order or on the email notifications. With some testing (Trial & Error) we've found that any filename over 40 characters including the file extension will fail. Hope this help you @AprilONeil |
Nice one @peterStoj! @mikejolley so you're aware, this issue did not appear in the error logs on local or prod environments, and it was Pressidium who had to dive into this a bit deeper on their side to discover the issue. Essentially what happens is the long filename seems to stop an entry being written to the |
@mateusz-michalik Do you know which column? We don't write filename to that table. |
Thanks guys for your investigation but this is not my issue :( I have really short filenames between 10 to 15 characters. Some file names with longer name are downloading and with shorter no. so everything which was uploaded to for example to So I did some test with files. For some test I edited old good product and added there newly uploaded file but still nothing. Only old was available. My next step was to create new product with one old working file and second one which was not working. No link in email or order page for both. So I created new product with old file (just a copy of one that already exist and was ok, and you know what? It also doesn't work. So I have two different products with same file and only one works good. The one which was created before Januray 2018. Since that time when I add new product no matter which file, the order is broken. So my issue is that when I am creating new product something is going wrong. I disabled all plugins and created new product again with file from correct old product and have same issue. |
@peterStoj might be able to give more detail @mikejolley - he spoke with Pressidium on the matter and got it resolved. |
I see this is closed, but what was the resolution? Experiencing the same issue on my site. |
@mikejolley Should this be reopened, since the original author's issue has not been fixed or a solution offered, and others are still experiencing this? Details on the same issue we're seeing. I'm going to look and see if I can find an entry in the permissions table for one that is broke: We have seen a few orders where a customer purchased a downloadable product but "Could not grant access - the user may already have permission for this file (FYI the billing email is set). So far this has happened at least twice, and we have to end up sending them the link via email. |
I managed to solve this issue by increasing length of download_id column under table ls_woocommerce_downloadable_product_permissions from 32 to 100 characters because somes download ids are more than 32 characters |
I have the same issue!... marwankhanfar give a good solution and works for new orders!... But I'm not able to grant access to completed or pending orders. Also creating a new order manually I'm not able to grant access to products. Seems nothing mentioned here works!... |
@marwankhanfar and others, perhaps the DB update routine failed for some reason (permissions?) because that column should be 36 length:
|
@marwankhanfar YAY! It works! Man you saved my life. I can add new products and they works fine. Thank you Sir! PS. I just checked this on one new product and one already exist product. I will test it tomorrow on the rest. |
@mikejolley I also have the same issue. I attempted to manually add it and received the error pop-up: "Could not grant access - the user may already have permission for this file After changing |
Findings The length of the varchar field needs to be increased, or maybe this shouldn't be storing the filename. Details
I found no entries in the permissions table when selecting by order ID or product ID of one of the broken orders (giving the alert error when attempting to grant permission). Selecting by the user email does show permissions for other orders. The broken order w/ downloadable product that I'm looking for has
So the error being received does not make sense, if there is no existing permission and the billing email is set. In addition to fixing the underlying issue, perhaps some error handling and better error message is needed to relay that an issue was encountered when attempting to store the permission. Looking at the permissions table for this user, it's very strange that the newer downloads are now using the file name, instead of the a hashed download ID. The change happened at the time we upgraded from 4.9.1 to 4.9.4, and WooCommerce from version 3.0.7 to 3.3.3. At this time we also updated all plugins and made template updates to clear up all warnings and errors from the major update in WooCommerce version. Is this how it should be saved currently in WooCommerce? Could a plugin be interfering with that? This explains why those earlier in the thread were having issues with long file names. If the file name is longer than the 36 chars, it won't save the permission.
I've gone ahead and altered the field to increase the number of characters, as some others here have done in the comments:
I then attempted to grant permission again and it worked! No more error message, and the permission was added. The new permissions entry that was created:
Note in case anyone else encounters this: I also had to temporarily disable 'NO_ZERO_IN_DATE' in sql_mode in order to alter the table. It didn't like the 0000-00-00 00:00:00 as the default date in access_granted. |
Definitely should not be a filename. Just a longer hash. Extension conflict is possible.. |
I get this issue in last woocommerce also.. Could not grant access - the user may already have permission for this file or billing email is not set. Ensure the billing email is set, and the order has been saved. |
We recently upgraded to 3.4.4 and deactivated the outdated "WooCommerce Dropbox" plugin that you were also using @DrMTR . That was likely the culprit as the problem of the download_id storing the file name is fixed. Note that proper IDs will only appear for permissions associated with newly added product downloads (not edited downloads which had this problem). |
Hello,
I am running latest version of WooCommerce on Nginx server with MariaDB database and I have issue with download link for some products. My Payment gateway is CryptoWoo with Bitcoins.
All products in my shop are set as Virtual and Downloadable. Download expiry is set to 15 days. Enable this to only allow one of this item to be bought in a single order is enabled. All files are zip, uploaded to the same server and all are active and available to download.
Wordpress Permalink are set as http://mysite.com/sample-post/
Product Permalink are set to default http://mysite.com/product/sample-product/
In downloadable section I have enebaled Grant access to downloadable products after payment
Some of products are visible after order and some of them no. When odder is complete customers get email with all info and link. Some products have this link and some of them no. There is only table with headers.
Also in /my-account/downloads/ section there is no link to ordered file.
No downloads available yet.
So for these orders I am sending file manually by email :(
Weird is that this is random. Some of customers bought same file and one of them have access to it and second one no. Some of customers bought for example two files and have link to only one.
When I am going to the order details Downloadable product permissions field is empty
I hit Order Actions -> Regenerate Download Permission but this doesn't fix it.
I tried to Grant Access to file manually but then I have error like: Could not grant access - the user may already have permission for this file or billing email is not set. Ensure the billing email is set, and the order has been saved.
I have no idea how to fix this. I compared accounts and products settings but everything looks the same.
My environment settings.
env.txt
The text was updated successfully, but these errors were encountered: