diff --git a/lib/galaxy/jobs/runners/drmaa.py b/lib/galaxy/jobs/runners/drmaa.py index 425108b4e85..70878a76849 100644 --- a/lib/galaxy/jobs/runners/drmaa.py +++ b/lib/galaxy/jobs/runners/drmaa.py @@ -212,9 +212,16 @@ class DRMAAJobRunner( AsynchronousJobRunner ): try: assert external_job_id not in ( None, 'None' ), '(%s/%s) Invalid job id' % ( galaxy_id_tag, external_job_id ) state = self.ds.jobStatus( external_job_id ) - # TODO: probably need to keep track of InvalidJobException count and remove after it exceeds some configurable - except ( drmaa.DrmCommunicationException, drmaa.InternalException, drmaa.InvalidJobException ), e: - log.warning( "(%s/%s) job check resulted in %s: %s", galaxy_id_tag, external_job_id, e.__class__.__name__, e ) + # InternalException was reported to be necessary on some DRMs, but + # this could cause failures to be detected as completion! Please + # report if you experience problems with this. + except ( drmaa.InvalidJobException, drmaa.InternalException ), e: + # we should only get here if an orphaned job was put into the queue at app startup + log.info( "(%s/%s) job left DRM queue with following message: %s" % ( galaxy_id_tag, external_job_id, e ) ) + self.work_queue.put( ( self.finish_job, ajs ) ) + continue + except drmaa.DrmCommunicationException, e: + log.warning( "(%s/%s) unable to communicate with DRM: %s" % ( galaxy_id_tag, external_job_id, e )) new_watched.append( ajs ) continue except Exception, e: diff --git a/lib/tool_shed/galaxy_install/tool_dependencies/td_common_util.py b/lib/tool_shed/galaxy_install/tool_dependencies/td_common_util.py index eb22124631e..d3dc4b6d737 100755 --- a/lib/tool_shed/galaxy_install/tool_dependencies/td_common_util.py +++ b/lib/tool_shed/galaxy_install/tool_dependencies/td_common_util.py @@ -9,7 +9,6 @@ import urllib2 import zipfile import tool_shed.util.shed_util_common as suc from galaxy.datatypes import checkers -from urllib2 import HTTPError log = logging.getLogger( __name__ ) diff --git a/lib/tool_shed/util/shed_util_common.py b/lib/tool_shed/util/shed_util_common.py index fde3d7cbdf4..f084643df00 100644 --- a/lib/tool_shed/util/shed_util_common.py +++ b/lib/tool_shed/util/shed_util_common.py @@ -21,6 +21,7 @@ from tool_shed.util import common_util from tool_shed.util import encoding_util from tool_shed.util import xml_util from xml.etree import ElementTree as XmlET +from urllib2 import HTTPError from galaxy import eggs eggs.require( 'mercurial' ) @@ -1232,10 +1233,25 @@ def get_tool_shed_status_for_installed_repository( app, repository ): try: encoded_tool_shed_status_dict = common_util.tool_shed_get( app, tool_shed_url, url ) tool_shed_status_dict = encoding_util.tool_shed_decode( encoded_tool_shed_status_dict ) + return tool_shed_status_dict + except HTTPError, e: + # This should handle backward compatility to the Galaxy 12/20/12 release. We used to only handle updates for an installed revision + # using a boolean value. + log.debug( "Error attempting to get tool shed status for installed repository %s: %s\nAttempting older 'check_for_updates' method.\n" % \ + ( str( repository.name ), str( e ) ) ) + url = url_join( tool_shed_url, + 'repository/check_for_updates?name=%s&owner=%s&changeset_revision=%s&from_update_manager=True' % \ + ( repository.name, repository.owner, repository.changeset_revision ) ) + try: + # The value of text will be 'true' or 'false', depending upon whether there is an update available for the installed revision. + text = common_util.tool_shed_get( app, tool_shed_url, url ) + return dict( revision_update=text ) + except Exception, e: + # The required tool shed may be unavailable, so default the revision_update value to 'false'. + return dict( revision_update='false' ) except Exception, e: log.exception( "Error attempting to get tool shed status for installed repository %s: %s" % ( str( repository.name ), str( e ) ) ) return {} - return tool_shed_status_dict def get_updated_changeset_revisions( trans, name, owner, changeset_revision ): """ diff --git a/static/scripts/galaxy.upload.js b/static/scripts/galaxy.upload.js index d0e13e7d059..340dac9dffe 100644 --- a/static/scripts/galaxy.upload.js +++ b/static/scripts/galaxy.upload.js @@ -57,6 +57,10 @@ var GalaxyUpload = Backbone.View.extend( return; } + // check if logged in + if (!Galaxy.currUser.get('id')) + return; + // add activate icon var self = this; this.button_show = new mod_master.GalaxyMasterIcon ( diff --git a/static/scripts/utils/galaxy.uploadbox.js b/static/scripts/utils/galaxy.uploadbox.js index 002c7c4122a..cc75da213cb 100755 --- a/static/scripts/utils/galaxy.uploadbox.js +++ b/static/scripts/utils/galaxy.uploadbox.js @@ -24,7 +24,8 @@ error_filesize : "File exceeds 2GB. Please use an FTP client.", error_default : "Please make sure the file is available.", error_server : "The server is unavailable.", - error_toomany : "You can only queue <20 files per upload session." + error_toomany : "You can only queue <20 files per upload session.", + error_login : "Uploads require you to log in." } // options @@ -158,6 +159,9 @@ // process an upload, recursive function process() { + // log + //console.log("Processing queue..." + queue_length + " (" + queue_running + " / " + queue_pause + ")"); + // validate if (queue_length == 0 || queue_pause) { @@ -167,6 +171,9 @@ return; } else queue_running = true; + + // log + //console.log("Looking for file..."); // get an identifier from the queue var index = -1; @@ -181,52 +188,23 @@ // remove from queue remove(index) + + // log + //console.log("Initializing ('" + file.name + "')."); - // start - var data = opts.initialize(index, file); + // identify maximum file size + var filesize = file.size; + var maxfilesize = 1048576 * opts.maxfilesize; - // add file to queue - try + // check file size + if (filesize < maxfilesize) { - // load file read - var reader = new FileReader(); - - // identify maximum file size - var filesize = file.size; - var maxfilesize = 1048576 * opts.maxfilesize; - - // set index - reader.index = index; - if (filesize < maxfilesize) - { - // link load - reader.onload = function(e) - { - send(index, file, data) - }; - - // link error - reader.onerror = function(e) - { - error(index, file, opts.error_default); - }; - - // link abort - reader.onabort = function(e) - { - error(index, file, opts.error_default); - }; - - // read data - reader.readAsDataURL(file); - } else { - // skip file - error(index, file, opts.error_filesize); - } - } catch (err) - { - // parse error - error(index, file, err); + // send data + var data = opts.initialize(index, file); + send(index, file, data) + } else { + // skip file + error(index, file, opts.error_filesize); } } @@ -241,10 +219,17 @@ // prepare request xhr = new XMLHttpRequest(); - + xhr.open('POST', opts.url, true); + xhr.setRequestHeader('Accept', 'application/json'); + xhr.setRequestHeader('Cache-Control', 'no-cache'); + xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); + // captures state changes xhr.onreadystatechange = function() { + // status change + //console.log("Status changed: " + xhr.readyState + "."); + // check for request completed, server connection closed if (xhr.readyState != xhr.DONE) return; @@ -264,14 +249,14 @@ // pass any error to the error option if (xhr.status < 200 || xhr.status > 299) { - // format error + // format status var text = xhr.statusText; - if (!xhr.statusText) { - if (xhr.status == 0) - text = opts.error_server; - else - text = opts.error_default; - } + if (xhr.status == 403) + text = opts.error_login; + else if (xhr.status == 0) + text = opts.error_server; + else if (!text) + text = opts.error_default; // request error error(index, file, text + " (" + xhr.status + ")"); @@ -284,13 +269,12 @@ xhr.upload.index = index; xhr.upload.file = file; xhr.upload.addEventListener('progress', progress, false); - - // open request - xhr.open('POST', opts.url, true); - xhr.setRequestHeader('Accept', 'application/json'); - xhr.setRequestHeader('Cache-Control', 'no-cache'); - xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); + + // send request xhr.send(formData); + + // sending file + //console.log("Sending file ('" + file.name + "')."); } // success @@ -360,7 +344,7 @@ // verify browser compatibility function compatible() { - return window.File && window.FileReader && window.FormData && window.XMLHttpRequest && window.FileList; + return window.File && window.FormData && window.XMLHttpRequest && window.FileList; } // export functions diff --git a/static/style/src/less/base.less b/static/style/src/less/base.less index 3ca807a8925..33b0ce8c5fd 100644 --- a/static/style/src/less/base.less +++ b/static/style/src/less/base.less @@ -1851,3 +1851,9 @@ div.toolTitleNoSection .icon-button.chevron-expand { .sprite(@chevron-expand-bw); } + +// honeypot for registration form + +#for_bears { + display: none; +} diff --git a/templates/user/register.mako b/templates/user/register.mako index 95580c588e9..45b9e2aa6c9 100644 --- a/templates/user/register.mako +++ b/templates/user/register.mako @@ -37,25 +37,82 @@ subscribe_check_box = CheckboxField( 'subscribe' ) %> +