Closed stevednicola closed 5 years ago
When you get a a blank page, is that due to the page hanging and failing to load, or does the request actually complete, and then you get a blank page?
First, thank you so much for replying. The page does not load if I call aws(). It just hangs.
Here is the live page: https://www.smartsysinc.com/project.cfm?p=Compact-Glass-Meeting-Space
It sounds like your server is not able to make an HTTP connection to AWS? The default timeout for HTTP requests is set at 50 seconds, have you waited that long to see if you get a timeout exception from the page request?
Yes. I also just tested raising that to 150 to no effect. Is it possible that AWS is denying requests because I am on the free tier? I have a CC on file.
Also, I might be doing something wrong, but I am not seeing anything going outbound on my browser developer tools.
You wouldn't see the request in the browser, it is made by the server. One a private page if you have one could you verify that your server can see AWS? Try something like:
cfhttp(url='https://s3.amazonaws.com', result='result', redirect=false);
writeDump(result);
That request should return a 307 redirect.
That code dumps a return from AWS.
https://www.smartsysinc.com/project.cfm?p=Compact-Meeting-Space
I know, I shouldn't do it on a live page, but maybe it will help...
Hmm, that is good :) but it makes me unsure of what is going on. Are you sure it is hanging on the http request itself, and not its attempt to process it?
Yesterday I could cfdump the AWS object and today I can’t.
It is hanging as I instantiate? it...
So after the CFHTTP request is made, this library attempts to process the returned XML - It would be good to be sure it is the request itself that is hanging, and not the post request processing. If you edit the services/s3.cfc
listBucket()
method to add an immediate return after the HTTP request it would clear this up:
var apiResponse = apiCall(
requestSettings,
'GET',
'/' & bucket,
queryParams
);
return apiResponse; // <-- add this line to see if the request gets this far
I completed the above code addition with no change.
Also, for clarification:
aws = new cfcs.aws( awsKey = '**', awsSecretKey = '**', defaultRegion = 'us-east-2' ); writeDump(aws);
This code doesn't return anything.
Ok, I think I misunderstood. I don't know why new cfcs.aws()
would stop working without throwing an exception. But this sounds like an issue with ACF, since with the code you showed above, aws
should be a component.
Yeah. It's really frustrating, because I have no idea what to do next... I think aws() calls api() and the hang up is happening there, but I am not sure...
If the code you provided above:
aws = new cfcs.aws(
awsKey = '',
awsSecretKey = '',
defaultRegion = 'us-east-2'
);
writeDump(aws);
hangs and doesn't dump anything, then the issue is there.
The only thing I did to aws.cfc is comment out the unused services:
component {
variables.services = [
//'cognitoIdentity',
//'dynamodb',
//'elasticsearch',
//'elastictranscoder',
//'kms',
//'personalize',
//'personalizeEvents',
//'personalizeRuntime',
//'sns',
//'sqs',
//'rekognition',
//'translate',
's3'
];
variables.constructorArgs = {
cognitoIdentity: { apiVersion: '2014-06-30' },
dynamodb: { apiVersion: '20120810' },
elastictranscoder: { apiVersion: '2012-09-25' },
elasticsearch: { endpoint: '' },
kms: { apiVersion: '2014-11-01' },
personalize: { apiVersion: '2018-05-22' },
personalizeRuntime: { apiVersion: '2018-05-22' },
personalizeEvents: { apiVersion: '2018-03-22' },
rekognition: { apiVersion: '2016-06-27' },
s3: { host: '', useSSL: true },
sns: { apiVersion: '2010-03-31' },
sqs: { apiVersion: '2012-11-05' },
translate: { apiVersion: '20170701', defaultSourceLanguageCode: 'es', defaultTargetLanguageCode: 'en' }
};
public struct function init(
string awsKey = '',
string awsSecretKey = '',
string defaultRegion = '',
struct constructorArgs = { }
) {
this.api = new com.api( awsKey, awsSecretKey, defaultRegion );
for ( var service in variables.services ) {
if ( structKeyExists( arguments.constructorArgs, service ) ) {
structAppend( variables.constructorArgs[ service ], arguments.constructorArgs[ service ] );
}
this[ service ] = new 'services.#service#'( this.api, variables.constructorArgs[ service ] );
}
return this;
}
}
Sorry, it is very puzzling. But there should be no issues in creating aws.cfc
- When you tested it by itself, did you pass in your aws key and secret key, or just empty strings? As long as you actually passed something in there, creation should be very straightforward and should not hang as long as ACF can find the components.
I am really sorry, I don't have time to do more debugging than this. Like I said, there is some issue with ColdFusion itself if new cfcs.aws(...)
doesn't error or return.
Sorry about the trouble. I am going to close this issue because it doesn't sound like a problem with this library specifically. If you find out that it is, you are welcome to reopen.
Alright, I have continued working the problem. I have commented out code and was able to get to this error:
The following is the internal exception message: access denied ("java.io.FilePermission" "D:/ColdFusion11/cfusion/wwwroot/WEB-INF/cfclasses/cfsignature_v42ecfc328059069$func_CF_ANONYMOUSCLOSURE_0.class" "read")
Would this have anything to do with the library or is this a server issue?
Pretty sure I am having weird server issues. I will get with my host. Thank you.
This is a server issue. Did you check that path to see if that Java class file actually exists? Either that file doesn't exist or due to file system permissions CF can't read the class file.
I agree talking to the host would be a good idea.
Installed code and everything was working flawlessly yesterday on CF implementation. I have made no code changes and today it no longer works. Further, I am getting no errors just a blank page. If I comment out the aws() call my page loads. I am only using the S3 service. Any ideas on how to troubleshoot what is going on?
Any help would be appreciated?