Copy link to clipboard
Copied
We recently upgraded our CF version from CF 10 to CF 2016. We ran into a few issues but sorted them out, mostly. We're now having an issue where our calls to S3 are not working. The server just spins until it finally times out. We don't see anything useful in the CF logs and have no real way of troubleshooting the problem.
When we revert the server back to CF10 the call works fine.
Here's the code:
<CFDIRECTORY directory="#application.S3URL#/medium/#lcase(variables.manufacturer)#" name="myBucket" />
where application.S3URL is like so: s3://#application.accessKeyid#:#application.awsSecretKey#@#application.S3Bucket#
Has anyone encountered this or have suggestions of possible settings mismatch?
Copy link to clipboard
Copied
When the server was upgraded to CF2016, did it keep the IP address?
I'm trying to think of reasons why S3 wouldn't respond (which appears to be the case.) Or, have you been watching the networking (F12) to see what _is_ coming back from S3?
V/r,
^ _ ^
Copy link to clipboard
Copied
No, the IP stayed the same.
We have 3 environments that are exactly the same, and the behavior is the same across all 3.
ColdFusion 2016 S3 issue
created by WolfShade<https://forums.adobe.com/people/WolfShade> in ColdFusion - View the full discussion<https://forums.adobe.com/message/10217165#10217165>
Copy link to clipboard
Copied
Try it in CF2016 with FireFox and open Developer Tools (F12) and click the NETWORK tab. Each call from the browser to the server will populate the screen; click any of the calls, and on the right side will be tabs for analyzing the responses from the server. Somewhere in there you might find an error message. Or you might find that nothing is coming back from any call. But, either way, you'll have a troubleshooting start point.
V/r,
^ _ ^
Copy link to clipboard
Copied
Yeah, I went through that just now in FF, no response.
Copy link to clipboard
Copied
Okay.. so now it becomes a question of .. is the S3 receiving a request and ignoring it, or (Dah, Dah, Daaaaaaah!) is it even receiving it?
The complete lack of a response makes me wonder if there might be some kind of proxy or firewall issue at play.
V/r,
^ _ ^
Copy link to clipboard
Copied
You mean something in CF 2016 that wasn’t in CF10? These 3 servers were in place upgrades, no changes other than CF.
Copy link to clipboard
Copied
Was this a plain install of CF2016, or were any updates applied?
V/r,
^ _ ^
Copy link to clipboard
Copied
It is up to date with the latest.
Tony Barroqueiro
Network Operations Manager
Fusionapps, LLC
Phone: 201-605-6158
Fax: 201-537-8137
Visit Us Online At: http://www.fusionapps.com<http://www.fusionapps.com/>
Copy link to clipboard
Copied
Have you contacted Amazon Support to see if they are aware of any compatibility issues between S3 and CF?
The first rule of troubleshooting is check your connection. Maybe their logs can tell you if your request is getting though to S3.
V/r,
^ _ ^
Copy link to clipboard
Copied
I just tested it on a CF11 server as well and it worked fine.
Tony Barroqueiro
Network Operations Manager
Fusionapps, LLC
Phone: 201-605-6158
Fax: 201-537-8137
Visit Us Online At: http://www.fusionapps.com<http://www.fusionapps.com/>
Copy link to clipboard
Copied
Have you tried CF2016 with no updates?
V/r,
^ _ ^
Copy link to clipboard
Copied
The farthest I could go back was to update 3. The installer I have already include up to that update.
Copy link to clipboard
Copied
We setup a page that only makes the call to S3 to troubleshoot this issue. I don't get a response from S3 when inspecting with F12
Copy link to clipboard
Copied
It seems like this may not be CF version specific. We reverted the production servers back to CF10 over the weekend and are still seeing the same behavior. We also have another server with CF2016 that runs a process that involves S3, and that works fine.
for reference:
When trying to run the following command, some directories return just fine, others do not. As far as I know, nothing has changed on S3 in years.
<CFDIRECTORY directory="#application.S3URL#/medium/#lcase(variables.manufacturer)#" name="myBucket" />
As a point of reference, the following command works just fine. Which basically uses the exact same paramaters/paths to S3.
<CFSET StoreSetACL("#application.S3URL#/medium/#lCase(variables.Manufacturer)#/#lcase(qry_images.Filename)#.jpg","#variables.perms#") />
Copy link to clipboard
Copied
Does the following directory exist on your new CF2016 installation: #application.S3URL#/medium/#lcase(variables.manufacturer)#. The following tests will give the answer:
<cfset s3Dir1 = application.S3URL & "/medium/" & lCase(variables.Manufacturer) >
<cfset s3Dir2 ="s3://" & application.accessKeyid & ":" & application.awsSecretKey & "@" & application.S3Bucket & "/medium/" & lCase(variables.Manufacturer)>
<cfoutput>
directoryExists(s3Dir1): #directoryExists(s3Dir1)# <br>
directoryExists(s3Dir2): #directoryExists(s3Dir2)#
</cfoutput>
Copy link to clipboard
Copied
Doesn't matter what directory I use, they ALL say NO to directoryExists. But some directories fetch a cfdirectory and some don't.
Here's one that works. As you can see, it still says NO to directoryExists, but fetches fine.
s3Dir1 = s3://[MASKED]:[MASKED]@dev.capitol.fusionapps.com/medium/2 thousand degrees
directoryExists(s3Dir1): NO
s3Dir2 = s3://[MASKED]:[MASKED]@dev.capitol.fusionapps.com/medium/2 thousand degrees
directoryExists(s3Dir2): NO
Copy link to clipboard
Copied
s3Dir1 = s3://[MASKED]:[MASKED]@dev.capitol.fusionapps.com/medium/2 thousand degrees
<cfset s3Dir1 = "s3://[MASKED]:[MASKED]@dev.capitol.fusionapps.com/medium/2 thousand degrees">
<cfoutput>
directoryExists(s3Dir1): #directoryExists(s3Dir1)#
</cfoutput>
What does directoryExists return in your ColdFusion 11 test?
Copy link to clipboard
Copied
As an aside, as far as S3 is concerned, there are no such thing as directories really. What we see as a directory is actually just part of the file path. So I wouldn't be surprised if CF doesn't treat S3 as having them in all cases.https://stackoverflow.com/questions/38051789/listing-files-in-a-specific-folder-of-a-aws-s3-bucket/3...
java - Listing files in a specific "folder" of a AWS S3 bucket - Stack Overflow
Dave Watts, Fig Leaf Software
Copy link to clipboard
Copied
I have a few thoughts, which may get you to your solution. But first, to be clear, you said that:
a) you rolled back the CF2016 instance that was having the problem, to CF10, and it STILL had the problem, right?
b) and on that instance (whether it's running as CF10 or 2016), SOME s3 requests work and some fail, right?
c) and you have still other servers (running CF11 or CF2016) where requests work, right?
1) It would seem very important/useful to come up with some examples of the specific s3 strings that DO and DO NOT work, with you removing any variables. Just show the full strings, as they resolved.
2) And I know you "masked" the accessid and secretkey, and it's understandable that you don't want those shared, but you may be losing something diagnostically significant in removing them entirely. Perhaps there is a difference in the ones working and not. How about instead replacing the values with simple strings like xxx, yyy, zzz, where all that share the same values are indicated the same way (like xxx).
3) Here again, don't presume that you KNOW the value variables names you see used (by going up in the app and copy/pasting the value and using that to make the decision about what to show). Instead, literally OUTPUT (for yourself) the value of the variables, where things are failing. You may find out that due to some logic error you're not considering, the value is NOT what you think it is.
I would think that armed with all this, you may well see yourself what the problem is, especially since you say some "work" and some "do not" on the same machine. If you'd think they were to the same s3 accessid and secret key, from the same machine (based on what you thought some variable resolved to), you may find that they are in fact NOT waht you expect and not the same.
4) When you say you "rolled back" to CF10, do you mean you re-installed it? Or you had a snapshot to backup to restore to? It's an important distinction. It could be that when it was "working as CF10", that CF10 had been installed one way, but when you "re-installed it" (to "roll back") you may have chosen different install settings. And you may have made the same choice in the CF2016 install as you did in the "reinstall" of CF10.
For instance, had you turned on the "secure profile" in the CF2016 and later re-install of CF10? If so, do you KNOW whether the earlier "working" CF10 install had had the secure profile enabled? In CF10, it was an install-time only question. Only in CF11 and above can you change that (or even confirm it) in the CF Admin. If you still had the install logs from the first CF10, there is indication in that log of whether secure profile was chosen.
And as for the CF11 that seems to be "working" for you, check if THAT one does or does not have Secure Profile enabled (in the CF Admin, on the Security>Secure Profile page). Beware also that the secure profile page shows about 20 admin settings that are affected by it, and you can override them, as shown on that page. you may want to closely assess all 20 features shown on the page, comparing the "working CF11" to the "failing" CF2016 or 10.
I'm not even saying that the secure profile features WOULD necessarily affect s3 processing (but they could, as could Security>Sandbox Security). I'm just saying that since you are finding there to be these curious changes in behavior, we should consider everything.
5) Indeed, finally, you say "nothing changed" about the CF2016 where it had been working and then was not. Have you confirmed that by looking at the audit.log (in that CF2016 logs, if it may still remain somewhere)? You may see that someone DID change something that you're not considering. Of course, not ALL admin changes are logged there, and changes made to the config files are not tracked in that log. Just some more thoughts.
Let us know if any of this helps.
Copy link to clipboard
Copied
The results for a functioning folder are the same (except CF11 seems to be escaping the spaces with +). A non functioning folder just times out on both systems.
A few notes/reminders.
Nothing has been touched on S3 in a few years. So no changes there.
Using the Cloudberry UI for S3, I double and triple checked that the ACLs were correct, and that I could see the folders.
I even created a copy of a non functional folder and it also times out.
I use the exact same API credentials for the Cloudberry UI as I am using in my CF modules.
Basically, one day everything worked fine, the next it's flakey. Neither S3 nor CF had any changes made in regards to the code.
CF11
s3Dir1 = s3://[Masked]:[Masked]@dev.capitol.fusionapps.com/medium/2 thousand degrees
directoryExists(s3Dir1): NO
s3Dir2 = s3://[Masked]:[Masked]@dev.capitol.fusionapps.com/medium/2 thousand degrees
directoryExists(s3Dir2): NO
<CFDIRECTORY directory="s3://[Masked]:[Masked]@dev.capitol.fusionapps.com/medium/2 thousand degrees" name="myBucket"> =
Fetched 183 Records. First 20:
medium/2+thousand+degrees/bolinas_ceiling_lg_ambr.jpg
medium/2+thousand+degrees/bolinas_ceiling_lg_w_mf.jpg
medium/2+thousand+degrees/bolinas_ceiling_sm_a_mf.jpg
medium/2+thousand+degrees/bolinas_ceiling_sm_white.jpg
medium/2+thousand+degrees/bolinas_large_a.jpg
medium/2+thousand+degrees/bolinas_large_white.jpg
medium/2+thousand+degrees/bolinas_small_amber.jpg
medium/2+thousand+degrees/bolinas_small_white.jpg
medium/2+thousand+degrees/cabo_grande_bz.jpg
medium/2+thousand+degrees/cabo_grande_sn.jpg
medium/2+thousand+degrees/chambers_flushmount_dsrtclay.jpg
medium/2+thousand+degrees/chambers_flushmount_white.jpg
medium/2+thousand+degrees/delancey_brown.jpg
medium/2+thousand+degrees/delancey_dclay.jpg
medium/2+thousand+degrees/delancey_red.jpg
medium/2+thousand+degrees/delancey_white.jpg
medium/2+thousand+degrees/dillon_brown.jpg
medium/2+thousand+degrees/dillon_white.jpg
medium/2+thousand+degrees/echo_pendant_amber.jpg
medium/2+thousand+degrees/echo_pendant_aqua.jpg
CF2016
s3Dir1 = s3://[Masked]:[Masked]@dev.capitol.fusionapps.com/medium/2 thousand degrees
directoryExists(s3Dir1): NO
s3Dir2 = s3://[Masked]:[Masked]@dev.capitol.fusionapps.com/medium/2 thousand degrees
directoryExists(s3Dir2): NO
<CFDIRECTORY directory="s3://[Masked]:[Masked]@dev.capitol.fusionapps.com/medium/2 thousand degrees" name="myBucket"> =
Fetched 183 Records. First 20:
medium/2 thousand degrees/bolinas_ceiling_lg_ambr.jpg
medium/2 thousand degrees/bolinas_ceiling_lg_w_mf.jpg
medium/2 thousand degrees/bolinas_ceiling_sm_a_mf.jpg
medium/2 thousand degrees/bolinas_ceiling_sm_white.jpg
medium/2 thousand degrees/bolinas_large_a.jpg
medium/2 thousand degrees/bolinas_large_white.jpg
medium/2 thousand degrees/bolinas_small_amber.jpg
medium/2 thousand degrees/bolinas_small_white.jpg
medium/2 thousand degrees/cabo_grande_bz.jpg
medium/2 thousand degrees/cabo_grande_sn.jpg
medium/2 thousand degrees/chambers_flushmount_dsrtclay.jpg
medium/2 thousand degrees/chambers_flushmount_white.jpg
medium/2 thousand degrees/delancey_brown.jpg
medium/2 thousand degrees/delancey_dclay.jpg
medium/2 thousand degrees/delancey_red.jpg
medium/2 thousand degrees/delancey_white.jpg
medium/2 thousand degrees/dillon_brown.jpg
medium/2 thousand degrees/dillon_white.jpg
medium/2 thousand degrees/echo_pendant_amber.jpg
medium/2 thousand degrees/echo_pendant_aqua.jpg
Copy link to clipboard
Copied
I'm curious if OP ever arrived at a solution for working with Amazon S3 directly in ColdFusion 2016? I ran into a similar problem and any time I run <cfdirectory action="list"...> on a bucket or bucket sub-folder the request waits for a very long time before eventually timing out.
I experimented with Joe Danziger's S3 wrapper on RIAforce (and Github: GitHub - joedanz/cf-amazon-s3: ColdFusion Amazon S3 REST Wrapper but it doesn't work with the modern version of Amazon's API. I searched Github for another project or possibly a more recent branch of this project without luck.
Has anyone been able to list the contents of a bucket "directory/object" using ColdFusion 2016?
Copy link to clipboard
Copied
I have a possible theory as to what may be wrong with the cfdirectory "list" action and why it could be timing out. The bucket I've been working with has about a hundred sub object/folders in it, with thousands of files each. I bet that the "list" is trying to get every file in the bucket (not just the root) and it is causing the timeout.
I stumbled upon the following project on GitHub: https://github.com/jcberquist/aws-cfml which seems to have a more modern implementation of S3 and when requesting the files in a bucket it limits the results to 1000. I was able to use this project to successfully query a list of files from the bucket in question. Hopefully this library will also help OP with their problem as well.
Copy link to clipboard
Copied
Homestar9, thanks for sharing the link to the AWS project on GitHub. Handy.
Copy link to clipboard
Copied
Maybe (your theory). However, I am using a recurse="false" and also have the same problem. On our CF2016 server I am running into a timeout on