sitecore6 - Programmatic upload to sitecore media library fails -


this 1 doozy.. should mention sitecore 6.5

we have been using method programmatically upload files sitecore's media library many years no problems:

public static mediaitem createmediaitem(string medialibrarypath, string filepath, string alttext, bool overwriteexisting) {     mediacreatoroptions options = new mediacreatoroptions();     options.database = factory.getdatabase("master");     options.language = sitecore.globalization.language.parse(settings.defaultlanguage);     options.versioned = settings.media.uploadasversionablebydefault;     options.keepexisting = !overwriteexisting;     options.destination = medialibrarypath.startswith("/") ?                                 "/sitecore/media library" + medialibrarypath :                                 "/sitecore/media library/" + medialibrarypath;     options.filebased = settings.media.uploadasfiles;     options.alternatetext = alttext;      mediacreator creator = new mediacreator();     mediaitem created = creator.createfromfile(filepath, options);      return created; } 

before attempt create media item have verified that

  • the file received client(we have saved temp folder)
  • we have correct folder in media library
  • file size limitations config in sitecore fine (media.maxsizeindatabase, etc.), files trying ~6mb , shouldn't problem
  • same result using media.uploadasfiles config true or false.
  • it's not disk threshold problem

due forces outside of control cannot debug directly on environment having problem, have logging.

with logging fine in our app until try create item method above. once method hit everything stops. mean

  • site becomes unresponsive
  • no logging app or sitecore
  • cannot access site until sitecore restarts
  • no errors in event log (windows) regarding application

and sitecore restart. no errors previous freeze.

now if wrap method in try catch more results, albeit strange -- after sitecore restarts catch block exception logged. here's whole record

3368 16:30:57 info  media path: /company documents/zesubdomain/small doc 3 3368 16:30:57 info  file path: f:\zecompany\websites\zesite.com\web\temp\a686d5a4-d3b4-474c-b54e-927edb247a84\qa test plan.docx  //this when method hit!  4004 16:32:13 info  httpmodule being initialized 3728 16:33:28 info  scheduler - adding agents 3728 16:33:28 info  scheduler - adding agent: sitecore.tasks.databaseagent (interval: 00:10:00) 3728 16:33:28 info  scheduler - adding agent: sitecore.tasks.databaseagent (interval: 00:10:00) 3728 16:33:28 info  scheduler - adding agent: sitecore.tasks.urlagent (interval: 01:00:00) 3728 16:33:28 info  scheduler - adding agent: sitecore.tasks.taskdatabaseagent (interval: 00:10:00) 3728 16:33:28 info  scheduler - adding agent: sitecore.tasks.compactclientdataagent (interval: 04:00:00) 3728 16:33:28 info  scheduler - adding agent: sitecore.tasks.cleanuphistory (interval: 04:00:00) 3728 16:33:28 info  scheduler - adding agent: sitecore.tasks.cleanuppublishqueue (interval: 04:00:00) 3728 16:33:28 info  scheduler - adding agent: sitecore.tasks.cleanupeventqueue (interval: 04:00:00) 3728 16:33:28 info  scheduler - skipping inactive agent: sitecore.tasks.htmlcacheclearagent 3728 16:33:29 info  scheduler - skipping inactive agent: sitecore.tasks.publishagent 3728 16:33:29 info  scheduler - adding agent: sitecore.tasks.cleanupagent (interval: 06:00:00) 3728 16:33:29 info  scheduler - adding agent: sitecore.tasks.clonenotificationscleanupagent (interval: 1.00:00:00) 3728 16:33:29 info  scheduler - adding agent: sitecore.tasks.cleanupfdaobsoletemediadata (interval: 1.00:00:00) 3728 16:33:29 info  scheduler - adding agent: sitecore.tasks.webdavoptionscleanupagent (interval: 1.00:00:00) 3728 16:33:29 info  scheduler - agents added managedpoolthread #3 16:38:29 info  job started: sitecore.tasks.databaseagent managedpoolthread #3 16:38:29 info  scheduling.databaseagent started. database: core managedpoolthread #3 16:38:29 info  examining schedules (count: 0) managedpoolthread #3 16:38:29 info  job ended: sitecore.tasks.databaseagent (units processed: ) managedpoolthread #4 16:38:29 info  job started: sitecore.tasks.databaseagent managedpoolthread #4 16:38:29 info  scheduling.databaseagent started. database: master managedpoolthread #4 16:38:29 info  examining schedules (count: 1) managedpoolthread #4 16:38:29 info  starting: __task schedule managedpoolthread #4 16:38:29 info  ended: __task schedule managedpoolthread #4 16:38:29 info  job ended: sitecore.tasks.databaseagent (units processed: 1) managedpoolthread #5 16:38:29 info  job started: sitecore.tasks.taskdatabaseagent managedpoolthread #5 16:38:29 info  processing tasks (count: 0) managedpoolthread #5 16:38:29 info  job ended: sitecore.tasks.taskdatabaseagent (units processed: ) 3896 16:39:01 info  httpmodule being initialized 3516 16:40:22 info  httpmodule being initialized 3368 16:41:11 info  failed on mediacreateitem! exception: system.threading.threadabortexception message: thread being aborted. source: mscorlib    @ system.runtimemethodhandle.invokemethod(object target, object[] arguments, signature sig, boolean constructor)    @ system.reflection.runtimeconstructorinfo.invoke(bindingflags invokeattr, binder binder, object[] parameters, cultureinfo culture)    @ sitecore.reflection.reflectionutil.createobject(type type, object[] parameters)    @ sitecore.configuration.factory.createfromtypename(xmlnode confignode, string[] parameters, boolean assert)    @ sitecore.configuration.factory.createobject(xmlnode confignode, string[] parameters, boolean assert, ifactoryhelper helper)    @ sitecore.configuration.factory.getinnerobject(xmlnode paramnode, string[] parameters, boolean assert)    @ sitecore.configuration.factory.assignproperties(xmlnode confignode, string[] parameters, object obj, boolean assert, boolean deferred, ifactoryhelper helper)    @ sitecore.configuration.factory.createobject(xmlnode confignode, string[] parameters, boolean assert, ifactoryhelper helper)    @ sitecore.configuration.factory.createobject(string configpath, string[] parameters, boolean assert)    @ sitecore.search.searchmanager.get_searchconfiguration()    @ sitecore.data.managers.indexingmanager.updateindexasync(database database)    @ sitecore.mainutil.raiseevent[t](eventhandler`1 subscribers, object sender, t eventargs)    @ sitecore.data.engines.historyengine.registeritemcreated(item item)    @ system.eventhandler`1.invoke(object sender, teventargs e)    @ sitecore.data.engines.datacommands.createitemcommand.executed()    @ sitecore.data.engines.enginecommand`2.execute()    @ sitecore.data.engines.dataengine.createitem(string itemname, item destination, id templateid, id newid)    @ sitecore.data.managers.itemprovider.createitem(string itemname, item destination, id templateid, id newid, securitycheck securitycheck)    @ sitecore.data.managers.itemmanager.createitem(string itemname, item destination, id templateid, id newid, securitycheck securitycheck)    @ sitecore.data.managers.itemmanager.createitem(string itemname, item destination, id templateid, id newid)    @ sitecore.nexus.data.datacommands.addfromtemplatecommand.(string itemname, item destination, id templateid, id newid)    @ sitecore.nexus.data.nexusdataapi.addfromtemplate(id templateid, item destination, string itemname, id newid)    @ sitecore.data.engines.datacommands.addfromtemplatecommand.doexecute()    @ sitecore.data.engines.enginecommand`2.execute()    @ sitecore.data.engines.dataengine.addfromtemplate(string itemname, id templateid, item destination, id newid)    @ sitecore.data.managers.itemprovider.addfromtemplate(string itemname, id templateid, item destination, id newid)    @ sitecore.data.managers.itemmanager.addfromtemplate(string itemname, id templateid, item destination, id newitemid)    @ sitecore.data.managers.itemmanager.addfromtemplate(string itemname, id templateid, item destination)    @ sitecore.data.items.item.add(string name, templateid templateid)    @ sitecore.data.items.item.add(string name, templateitem template)    @ sitecore.resources.media.mediacreator.createitem(string itempath, string filepath, mediacreatoroptions options)    @ sitecore.resources.media.mediacreator.attachstreamtomediaitem(stream stream, string itempath, string filename, mediacreatoroptions options)    @ sitecore.resources.media.mediacreator.createfromstream(stream stream, string filepath, mediacreatoroptions options)    @ sitecore.resources.media.mediacreator.createfromfile(string filepath, mediacreatoroptions options)    @ prepariscore.utilities.sitecorehelper.masterdatabase.createmediaitem(string medialibrarypath, string filepath, string alttext, boolean overwriteexisting) in c:\teamcity\buildagents\production\work\4a6b68672be2163f\main\companycore\utilities\sitecorehelper.cs:line 682    @ prepariscore.utilities.documenthelper.savedocumentmediafile(document doc, boolean storepreparis, boolean storeprivate, fileupload fileupload) in c:\teamcity\buildagents\production\work\4a6b68672be2163f\main\companycore\utilities\documenthelper.cs:line 292  3368 16:41:13 error application error. exception: system.web.httpexception message: request timed out. 

this full 10 minutes after method called.

this hasn't been problem until , far can tell haven't made changes remotely affect part of system. can take guess @ might cause or start looking? how more diagnostic information other directly debugging?


Comments

Popular posts from this blog

c++ - OpenMP unpredictable overhead -

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

javascript - Wordpress slider, not displayed 100% width -