python常见的报错

pip3 安装salt报错

pip3 install salt

安装python36-devel 问题解决

yum install python3.6-devel

saltstack 执行命令出错

Minion did not return. [No response]

查看minion的日志

[email protected]: ~ # tail -f /var/log/salt/minion
The master public key can be found at:
/etc/salt/pki/minion/minion_master.pub
2019-08-23 03:01:05,340 [salt.crypt       ][ERROR   ][22697] The master key has changed, the salt master could have been subverted, verify salt master's public key
2019-08-23 03:01:05,341 [salt.crypt       ][CRITICAL][22697] The Salt Master server's public key did not authenticate!

删除公钥并重启minion

[email protected]: ~ # cat /etc/salt/pki/minion/minion_master.pub
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzZ0JW14Ddso9t14i7Q9e
xnw5E/q8AAFQm9oi5ON0Q3wcnVabp8qrkM6iwf7yIelBrz9HWkys8e5PVnX80Tr9
/uhRX7JwXxHTUfVqwTaBvSF+ShNKWrB8IFl4ZER4bn6V9BtTty1UsE6t/nh4iSPO
uW1UWsgv0BNpTOj6o1cQSQnUdBEIH0mYYQPCBwY/0avqbpB7NblZH5PLfe3a7bG1
N+jrbjla5Wo0KOICrD6qJlp/5cUsq5YnGKMnDtwgP0oQ9lSr8rP4qWpWnhIkjI69
n3/yAjmCehnK+7SZBaxrqhRPRT/muphpwmqhmVtQSjLjNXoKjBHCC5+UAiveLdmC
/QIDAQAB
-----END PUBLIC KEY-----
[email protected]: ~ # rm -rf /etc/salt/pki/minion/minion_master.pub
[email protected]: ~ # systemctl restart salt-minion

master端可以正常和minion通信

[email protected]: ~ # salt 'slave1' cmd.run 'ip a'
slave1:
    1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
        link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
        inet 127.0.0.1/8 scope host lo
           valid_lft forever preferred_lft forever
        inet6 ::1/128 scope host
           valid_lft forever preferred_lft forever
    2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
        link/ether 00:0c:29:2e:48:02 brd ff:ff:ff:ff:ff:ff
        inet 172.16.240.130/24 brd 172.16.240.255 scope global noprefixroute ens33
           valid_lft forever preferred_lft forever
        inet6 fe80::bc7e:e9f9:591c:208d/64 scope link noprefixroute
           valid_lft forever preferred_lft forever

Django ORM


mysql.W002

System check identified some issues:

WARNINGS:
?: (mysql.W002) MySQL Strict Mode is not set for database connection 'default'
    HINT: MySQL's Strict Mode fixes many data integrity problems in MySQL, such as data truncation upon insertion, by escalating warnings into errors. It is strongly recommended you activate it. See: https://docs.djangoproject.com/en/1.11/ref/databases/#mysql-sql-mode

解决: 在setting.py中添加选项

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'cmdb1',
        'HOST': '127.0.0.1',
        'USER': 'root',
        'PASSWORD': '123',
        'PORT': 3306,
        'CHARSET': 'utf8',
        'OPTIONS': {
            "init_command": "SET default_storage_engine='INNODB'"
        }
    }
}
DATABASES['default']['OPTIONS']['init_command'] = "SET sql_mode='STRICT_TRANS_TABLES'"

原文地址:https://www.cnblogs.com/cjwnb/p/11809084.html

时间: 2024-10-20 14:06:09

python常见的报错的相关文章

[Python] 运行Flask, 报错:UnicodeDecodeError: &#39;ascii&#39; codec can&#39;t decode byte 0xc4 in position 33: ordinal not in range(128)

运行时报错:UnicodeDecodeError: 'ascii' codec can't decode byte 0xc4 in position 33: ordinal not in range(128) Python2.7在Windows上一个bug!!! 解决方法: 参考官方patch: http://bugs.python.org/file19332/9291a.patch 如下代码:一,加入from itertools import count: 二,修改 def enum_type

python框架Scrapy报错TypeError: &#39;float&#39; object is not iterable解决

原因是:Twisted版本高了. 解决办法: 只要把Twisted库降级到16.6.0即可: 1 pip3 install Twisted==16.6.0 2 3 注:Twisted16.6.0安装后,会自动卸载高版本的Twisted python框架Scrapy报错TypeError: 'float' object is not iterable解决

python中文注释报错问题

错误信息: SyntaxError: Non-ASCII character '\xe4' in file... 解决办法: 在文件第一行或第二行添加:# -*- coding: utf-8 -*- 参考:http://blog.csdn.net/chen861201/article/details/7706535 python中文注释报错问题,布布扣,bubuko.com

linux运维常见英文报错中文翻译(菜鸟必知)

linux常见英文报错中文翻译(菜鸟必知) 1.command not found   命令没有找到 2.No such file or directory   没有这个文件或目录 3.Permission denied   权限不足 4.No space left on device   磁盘没有剩余空间 5.File exists   文件已经存在 6.Is a directory   这是1个目录 7.Not a directory   不是1个目录 8.Warning: Changing

Windows下使用pip安装python包是报错-UnicodeDecodeError: &#39;ascii&#39; codec can&#39;t decode byte 0xcb in position 0

先交待下开发环境: 操作系统:Windows 7 Python版本:2.7.9 Pip版本:6.1.1 其他环境忽略 在windows下使用pip下载python包,出现如下错误 [plain] view plain copy Collecting xxxxxx Exception: Traceback (most recent call last): File "D:\Python27\lib\site-packages\pip-6.0.8-py2.7.egg\pip\basecommand.

python安装locustio报错error: invalid command &#39;bdist_wheel&#39;的解决方法

locust--scalable user load testing tool writen in Python(是用python写的.规模化.可扩展的测试性能的工具) 安装locustio需要的环境条件是:Python2.6+,但是不支持Python3. 今天在cmd里运行pip install locustio,报错提示:error: invalid command 'bdist_wheel'. 原因:pip和setuptools的版本较低. 解决方案:升级pip和setuptools. 一

python 链接codis 报错解决办法 command &#39;EXEC&#39; is not allowed

[[email protected] ceph]# python ../pkg/redisbase.py Traceback (most recent call last):   File "../pkg/redisbase.py", line 85, in redis_hget     values = self.pipe.execute()   File "/usr/lib/python2.7/site-packages/redis/client.py", li

python 网络爬虫报错“UnicodeDecodeError: &#39;utf-8&#39; codec can&#39;t decode byte 0x8b in position”解决方案

Python3.x爬虫, 发现报错"UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8b in position 1:invalid start byte",一直在找文件的错误,最后经过网友的提示,错误原因竟然是我的报头中有一条: "'Accept-Encoding': 'gzip, deflate'" 这一条是我从Fiddler直接复制过来的,为什么用浏览器可以正常浏览,而用Python模仿就不行呢? 综

命令行运行python项目文件,报错:ModuleNotFoundError: No module named &#39;xxxx&#39; 解决办法

在pycharm中写好了自动化测试脚本,并能在pycharm中正常运行,由于要考虑到无人值守时能自动执行,执行时就需要脱离pycharm,直接能用命令执行.但是直接用命令执行用例文件:python3 D:\pycode\autotest_framework\case\run_case.py 结果报错,找不到模块 自动化项目的结构如下:用例run_case.py 和工具类utils下的工具 不在同一个文件夹下面.在脚本中需要导入包如: from utils.HTMLTestRunner impor