GVKun编程网logo

Windows 下执行 celery4.1 报错 Task handler raised error: ValueError (''not enough values to unpack (exp...

17

如果您对Windows下执行celery4.1报错Taskhandlerraisederror:ValueError(''notenoughvaluestounpack(exp...感兴趣,那么这篇文

如果您对Windows 下执行 celery4.1 报错 Task handler raised error: ValueError (''not enough values to unpack (exp...感兴趣,那么这篇文章一定是您不可错过的。我们将详细讲解Windows 下执行 celery4.1 报错 Task handler raised error: ValueError (''not enough values to unpack (exp...的各种细节,此外还有关于ajaxfileupload.js 报Uncaught TypeError: jQuery.handleError is not a function错误、alert日志报错:ERROR: failed to establish dependency between database RACDB and diskgroup resource ora...、Andrew Ng class2 week1:ValueError: c of shape (1, 300) not acceptable as a color sequence for x w...、Android studio 报错 Error:Internal error: (java.lang.ClassNotFoundException) com.google.wireless.and...的实用技巧。

本文目录一览:

Windows 下执行 celery4.1 报错 Task handler raised error: ValueError (''not enough values to unpack (exp...

Windows 下执行 celery4.1 报错 Task handler raised error: ValueError (''not enough values to unpack (exp...

 错误信息如下所示,根据网上查找发现 celery4 版本起已经不支持 windows 了,所以会报此错误,解决方法

1 如果要用 windows 来实现的话,请降低版本到 3 版本

2 可以用 linux 系统   linux 系统支持 4.1 版本,不会发生如下错误

 

from celery import Celery
 
app = Celery(''tasks'',
             broker=''redis://localhost'',
             backend=''redis://localhost'')
 
@app.task
def add(x,y):
    print("running...",x,y)
    return x+y

 

 windows 下报错信息如下

[2018-01-10 14:23:01,932: INFO/MainProcess] Received task: task.add[4d68d561-e835-4592-a4d4-0f4799700df8]
[2018-01-10 14:23:01,951: ERROR/MainProcess] Task handler raised error: ValueError(''not enough values to unpack (expected 3, got 0)'',)
Traceback (most recent call last):
  File "d:\program files (x86)\python\python36\lib\site-packages\billiard\pool.py", line 358, in workloop
    result = (True, prepare_result(fun(*args, **kwargs)))
  File "d:\program files (x86)\python\python36\lib\site-packages\celery\app\trace.py", line 525, in _fast_trace_task
    tasks, accept, hostname = _loc
ValueError: not enough values to unpack (expected 3, got 0)
[2018-01-10 14:25:54,285: INFO/MainProcess] Received task: task.add[e0593045-acb4-414d-ab6e-45ac7b636084]
[2018-01-10 14:25:57,287: ERROR/MainProcess] Task handler raised error: ValueError(''not enough values to unpack (expected 3, got 0)'',)
Traceback (most recent call last):
  File "d:\program files (x86)\python\python36\lib\site-packages\billiard\pool.py", line 358, in workloop
    result = (True, prepare_result(fun(*args, **kwargs)))
  File "d:\program files (x86)\python\python36\lib\site-packages\celery\app\trace.py", line 525, in _fast_trace_task
    tasks, accept, hostname = _loc
ValueError: not enough values to unpack (expected 3, got 0)
[2018-01-10 14:42:36,239: INFO/MainProcess] Received task: task.add[be45c703-b833-44c5-8f4f-7c81bbcc2cf0]
[2018-01-10 14:42:36,253: ERROR/MainProcess] Task handler raised error: ValueError(''not enough values to unpack (expected 3, got 0)'',)

 

 

Centos 7 下使用 celery4.1 可以正常执行

客户端

[python@qinhan file]$ python
Python 3.6.2 (default, Jan 10 2018, 16:15:47) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-16)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from task import add
>>> add.delay(5,7)
<AsyncResult: 598a600d-7b49-4ba4-8d7b-85692027b46d>
>>>

 

Celery 端

[root@qinhan file]# celery -A task worker --loglevel=info
/usr/local/python3/lib/python3.6/site-packages/celery/platforms.py:795: RuntimeWarning: You''re running the worker with superuser privileges: this is
absolutely not recommended!

Please specify a different user using the -u option.

User information: uid=0 euid=0 gid=0 egid=0

  uid=uid, euid=euid, gid=gid, egid=egid,
 
 -------------- celery@qinhan v4.1.0 (latentcall)
---- **** ----- 
--- * ***  * -- Linux-3.10.0-327.el7.x86_64-x86_64-with-centos-7.2.1511-Core 2018-01-11 16:59:47
-- * - **** --- 
- ** ---------- [config]
- ** ---------- .> app:         tasks:0x7f4262d718d0
- ** ---------- .> transport:   redis://localhost:6379//
- ** ---------- .> results:     redis://localhost/
- *** --- * --- .> concurrency: 4 (prefork)
-- ******* ---- .> task events: OFF (enable -E to monitor tasks in this worker)
--- ***** ----- 
 -------------- [queues]
                .> celery           exchange=celery(direct) key=celery
                

[tasks]
  . task.add

[2018-01-11 16:59:47,385: INFO/MainProcess] Connected to redis://localhost:6379//
[2018-01-11 16:59:47,403: INFO/MainProcess] mingle: searching for neighbors
[2018-01-11 16:59:48,444: INFO/MainProcess] mingle: all alone
[2018-01-11 16:59:48,465: INFO/MainProcess] celery@qinhan ready.
[2018-01-11 17:06:57,465: INFO/MainProcess] Received task: task.add[598a600d-7b49-4ba4-8d7b-85692027b46d]  
[2018-01-11 17:06:57,472: WARNING/ForkPoolWorker-1] running...
[2018-01-11 17:06:57,473: WARNING/ForkPoolWorker-1] 5
[2018-01-11 17:06:57,474: WARNING/ForkPoolWorker-1] 7
[2018-01-11 17:06:57,490: INFO/ForkPoolWorker-1] Task task.add[598a600d-7b49-4ba4-8d7b-85692027b46d] succeeded in 0.018820124001649674s: 12

 

ajaxfileupload.js 报Uncaught TypeError: jQuery.handleError is not a function错误

ajaxfileupload.js 报Uncaught TypeError: jQuery.handleError is not a function错误

因为“handleError”函数是在低版本的jquery 中的函数,所以解决方案是从低版本中的jquery 中找到这个函数

handleError: function( s,xhr,status,e )      {  
            // If a local callback was specified,fire it  
                    if ( s.error ) {  
                        s.error.call( s.context || s,e );  
                    }  
                    // Fire the global callback  
                    if ( s.global ) {  
                        (s.context ? jQuery(s.context) : jQuery.event).trigger( "ajaxError",[xhr,s,e] );  
                    }  
       }

把这个函数加入ajaxfileupload.js中去,就不报错了。

jQuery.extend({


    createUploadIframe: function(id,uri)
    {
        //create frame
        var frameId = 'jUploadFrame' + id;

        if(window.ActiveXObject) {
            var io = document.createElement('<iframe id="' + frameId + '" name="' + frameId + '" />');
            if(typeof uri== 'boolean'){
                io.src = 'javascript:false';
            }
            else if(typeof uri== 'string'){
                io.src = uri;
            }
        }
        else {
            var io = document.createElement('iframe');
            io.id = frameId;
            io.name = frameId;
        }
        io.style.position = 'absolute';
        io.style.top = '-1000px';
        io.style.left = '-1000px';

        document.body.appendChild(io);

        return io
    },createUploadForm: function(id,fileElementId)
    {
        //create form
        var formId = 'jUploadForm' + id;
        var fileId = 'jUploadFile' + id;
        var form = $('<form  action="" method="POST" name="' + formId + '" id="' + formId + '" enctype="multipart/form-data"></form>');
        var oldElement = $('#' + fileElementId);
        var newElement = $(oldElement).clone();
        $(oldElement).attr('id',fileId);
        $(oldElement).before(newElement);
        $(oldElement).appendTo(form);
        //set attributes
        $(form).css('position','absolute');
        $(form).css('top','-1200px');
        $(form).css('left','-1200px');
        $(form).appendTo('body');
        return form;
    },//就是这个函数。
    handleError: function( s,e] );  
                    }  
       },addOtherRequestsToForm: function(form,data)
    {
        // add extra parameter
        var originalElement = $('<input type="hidden" name="" value="">');
        for (var key in data) {
            name = key;
            value = data[key];
            var cloneElement = originalElement.clone();
            cloneElement.attr({'name':name,'value':value});
            $(cloneElement).appendTo(form);
        }
        return form;
    },ajaxFileUpload: function(s) {
        // Todo introduce global settings,allowing the client to modify them for all requests,not only timeout
        s = jQuery.extend({},jQuery.ajaxSettings,s);
        var id = new Date().getTime()
        var form = jQuery.createUploadForm(id,s.fileElementId);
        if ( s.data ) form = jQuery.addOtherRequestsToForm(form,s.data);
        var io = jQuery.createUploadIframe(id,s.secureuri);
        var frameId = 'jUploadFrame' + id;
        var formId = 'jUploadForm' + id;
        // Watch for a new set of requests
        if ( s.global && ! jQuery.active++ )
        {
            jQuery.event.trigger( "ajaxStart" );
        }
        var requestDone = false;
        // Create the request object
        var xml = {}
        if ( s.global )
            jQuery.event.trigger("ajaxSend",[xml,s]);
        // Wait for a response to come back
        var uploadCallback = function(isTimeout)
        {
            var io = document.getElementById(frameId);
            try
            {
                if(io.contentwindow)
                {
                    xml.responseText = io.contentwindow.document.body?io.contentwindow.document.body.innerHTML:null;
                    xml.responseXML = io.contentwindow.document.XMLDocument?io.contentwindow.document.XMLDocument:io.contentwindow.document;

                }else if(io.contentDocument)
                {
                    xml.responseText = io.contentDocument.document.body?io.contentDocument.document.body.innerHTML:null;
                    xml.responseXML = io.contentDocument.document.XMLDocument?io.contentDocument.document.XMLDocument:io.contentDocument.document;
                }
            }catch(e)
            {
                jQuery.handleError(s,xml,null,e);
            }
            if ( xml || isTimeout == "timeout")
            {
                requestDone = true;
                var status;
                try {
                    status = isTimeout != "timeout" ? "success" : "error";
                    // Make sure that the request was successful or notmodified
                    if ( status != "error" )
                    {
                        // process the data (runs the xml through httpData regardless of callback)
                        var data = jQuery.uploadHttpData( xml,s.dataType );
                        // If a local callback was specified,fire it and pass it the data
                        if ( s.success )
                            s.success( data,status );

                        // Fire the global callback
                        if( s.global )
                            jQuery.event.trigger( "ajaxSuccess",s] );
                    } else
                        jQuery.handleError(s,status);
                } catch(e)
                {
                    status = "error";
                    jQuery.handleError(s,e);
                }

                // The request was completed
                if( s.global )
                    jQuery.event.trigger( "ajaxComplete",s] );

                // Handle the global AJAX counter
                if ( s.global && ! --jQuery.active )
                    jQuery.event.trigger( "ajaxStop" );

                // Process result
                if ( s.complete )
                    s.complete(xml,status);

                jQuery(io).unbind()

                setTimeout(function()
                {	try
                    {
                        $(io).remove();
                        $(form).remove();

                    } catch(e)
                    {
                        jQuery.handleError(s,e);
                    }

                },100)

                xml = null

            }
        }
        // Timeout checker
        if ( s.timeout > 0 )
        {
            setTimeout(function(){
                // Check to see if the request is still happening
                if( !requestDone ) uploadCallback( "timeout" );
            },s.timeout);
        }
        try
        {
            // var io = $('#' + frameId);
            var form = $('#' + formId);
            $(form).attr('action',s.url);
            $(form).attr('method','POST');
            $(form).attr('target',frameId);
            if(form.encoding)
            {
                form.encoding = 'multipart/form-data';
            }
            else
            {
                form.enctype = 'multipart/form-data';
            }
            $(form).submit();

        } catch(e)
        {
            jQuery.handleError(s,e);
        }
        if(window.attachEvent){
            document.getElementById(frameId).attachEvent('onload',uploadCallback);
        }
        else{
            document.getElementById(frameId).addEventListener('load',uploadCallback,false);
        }
        return {abort: function () {}};

    },uploadHttpData: function( r,type ) {
        var data = !type;
        data = type == "xml" || data ? r.responseXML : r.responseText;
        // If the type is "script",eval it in global context
        if ( type == "script" )
            jQuery.globalEval( data );
        // Get the JavaScript object,if JSON is used.
        if ( type == "json" )
        {
            // If you add mimetype in your response,// you have to delete the '<pre></pre>' tag.
            // The pre tag in Chrome has attribute,so have to use regex to remove
            var data = r.responseText;
            var rx = new RegExp("<pre.*?>(.*?)</pre>","i");
            var am = rx.exec(data);
            //this is the desired data extracted
            var data = (am) ? am[1] : "";    //the only submatch or empty
            eval( "data = " + data );
        }
        // evaluate scripts within html
        if ( type == "html" )
            jQuery("<div>").html(data).evalScripts();
        //alert($('param',data).each(function(){alert($(this).attr('value'));}));
        return data;
    }
})

alert日志报错:ERROR: failed to establish dependency between database RACDB and diskgroup resource ora...

alert日志报错:ERROR: failed to establish dependency between database RACDB and diskgroup resource ora...

一。打开数据库alert日志,发现有报错

ERROR: failed to establish dependency between database RACDB and diskgroup resource ora.DATA.dg

 

二。上mos查看(是一个BUG,无害)

This error is harmless.

It is documented in the  internal Bug 8304720 "ERROR: FAILED TO ESTABLISH DEPENDENCY BETWEEN DB & DISKGROUP"

 

三。解决

$ srvctl modify database -d <db_unique_name> -a "<diskgroup_list>"

 我自己的库只有DATA和OCR两个磁盘组,所以执行一下命令:

srvctl modify database -d RACDB -a "DATA,OCR"

Andrew Ng class2 week1:ValueError: c of shape (1, 300) not acceptable as a color sequence for x w...

Andrew Ng class2 week1:ValueError: c of shape (1, 300) not acceptable as a color sequence for x w...

最后一行改成这个:

plot_decision_boundary(lambda x: predict_dec(parameters, x.T), train_X, np.squeeze(train_Y))

Android studio 报错 Error:Internal error: (java.lang.ClassNotFoundException) com.google.wireless.and...

Android studio 报错 Error:Internal error: (java.lang.ClassNotFoundException) com.google.wireless.and...

Android studio 运行 make build 报错

 

 

解决方法

在 studio 的 File-->Settings-->Build, Execution, Deployment---> Java Compiler 选项中,

将 javac 改为 eclipse,最后 apply 一下,如图

 

 

 

 

今天关于Windows 下执行 celery4.1 报错 Task handler raised error: ValueError (''not enough values to unpack (exp...的分享就到这里,希望大家有所收获,若想了解更多关于ajaxfileupload.js 报Uncaught TypeError: jQuery.handleError is not a function错误、alert日志报错:ERROR: failed to establish dependency between database RACDB and diskgroup resource ora...、Andrew Ng class2 week1:ValueError: c of shape (1, 300) not acceptable as a color sequence for x w...、Android studio 报错 Error:Internal error: (java.lang.ClassNotFoundException) com.google.wireless.and...等相关知识,可以在本站进行查询。

本文标签: