Details
Assignee
Michael OffnerMichael OffnerReporter
Former userFormer user(Deactivated)Priority
CriticalLabels
New Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Sprint
Affects versions
Details
Details
Assignee
Michael Offner
Michael OffnerReporter
Former user
Former user(Deactivated)Priority
Labels
New Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Sprint
Affects versions
Created 26 October 2020 at 04:24
Updated last week
Not sure how I am getting this error in my thread log.
"ERROR","cfthread-594303","10/25/2020","17:39:59","cfthread-594303","the thread scope cannot be modified from outside the owner thread;the thread scope cannot be modified from outside the owner thread;lucee.runtime.exp.ApplicationException: the thread scope cannot be modified from outside the owner
thread
at lucee.runtime.thread.ThreadsImpl.errorOutside(ThreadsImpl.java:395)
at lucee.runtime.thread.ThreadsImpl.set(ThreadsImpl.java:271)
at lucee.runtime.type.util.StructSupport.set(StructSupport.java:262)
at lucee.runtime.util.VariableUtilImpl.set(VariableUtilImpl.java:424)
at lucee.runtime.PageContextImpl.set(PageContextImpl.java:1458)
at bay.s3_cfc$cf$133.threadCall(/bay/s3.cfc:163)
at lucee.runtime.thread.ChildThreadImpl.execute(ChildThreadImpl.java:203)
at lucee.runtime.thread.ChildThreadImpl.run(ChildThreadImpl.java:145)
"
line 163 = thread.result = local.s3.putObject(bucket=attributes.bucket, objectkey=attributes.path_to_resource, filecontent=local.body, contenttype=local.contentType);
function upload(resource, file, string contents = '', boolean waitForComplete = true){
if(IsSimpleValue(arguments.file)){
local.files = [arguments.file];
}
if(IsArray(arguments.file)){
local.files = Duplicate(arguments.file);
}
local.ret = StructNew();
local.threads = StructNew();
local.parse = parseResource(arguments.resource);
local.p_endpoint = local.parse.endpoint;
local.p_bucket = local.parse.bucket;
local.p_resource = local.parse.resource;
for(local.file in local.files){
local.threadname = 'thread_' & replace(createUUID(), '-', '', 'ALL');
local.threads[local.threadname] = local.file;
if(local.file contains '/'){
local.path_to_resource = '#local.p_resource#/#listlast(local.file, "/")#';
}else{
local.path_to_resource = '#local.p_resource#/#listlast(local.file, "\")#';
}
thread action="run", name="#local.threadname#", file="#local.file#", endpoint="#local.p_endpoint#", path_to_resource="#local.path_to_resource#", bucket="#local.p_bucket#", contents="#arguments.contents#" {
if(left(attributes.file, 4) eq 'http'){
http result="local.GET", method="GET", url="#attributes.file#", getasbinary="yes" {}
local.body = local.GET.filecontent;
}else{
if(attributes.contents eq ''){
local.body = fileReadBinary(attributes.file);
}else{
local.body = attributes.contents;
}
}
local.s3 = this.aws[attributes.endpoint].s3;
thread.attributes = attributes;
switch(listLast(attributes.path_to_resource, '.')){
case 'jpg':
local.contentType = 'image/jpeg';
break;
case 'gif':
local.contentType = 'image/gif';
break;
case 'png':
local.contentType = 'image/png';
break;
case 'pdf':
local.contentType = 'application/pdf';
break;
case 'html':
local.contentType = 'text/html';
break;
default:
local.contentType = '';
break;
}
thread.result = local.s3.putObject(bucket=attributes.bucket, objectkey=attributes.path_to_resource, filecontent=local.body, contenttype=local.contentType);
thread.status_code = thread.result.statusCode;
}
}
if(arguments.waitForComplete){
threadJoin(StructKeyList(local.threads));
for(local.thread in local.threads){
local.ret[local.threads[local.thread]] = evaluate(local.thread);
}
return local.ret;
}else{
return true;
}
}