攒点BUG




2019-04-20

ISSUE

1
ERROR: more than one row returned by a subquery used as an expression

SOLUTION

1
2
3
4
5
6
7
8
9
SELECT
field1,field2,
(select ARRAY_AGG(field3) from b where exp)
FROM
a
WHERE
exp
ORDER BY
field1;

2019-03-11

ISSUE

1
2
3
4
# 连接中断,返回的相应大小被限制在127.86kb
SIGPIPE: writing to a closed pipe/socket/fd (probably the client disconnected) on request /project/api/ !!!
uwsgi_response_write_body_do(): Broken pipe [core/writer.c line 341] during GET /project/api/
IOError: write error

SOLUTION

1
2
# 打开Nginx配置文件 调整默认的限制缓存大小 根据实际业务调整
uwsgi_buffers 8 512k; 默认为8 4k 8为数量

2019-01-12

ISSUE

1
2
3
Crypto/PublicKey/RSA.py", line 375, in decrypt
raise NotImplementedError("Use module Crypto.Cipher.PKCS1_OAEP instead")
NotImplementedError: Use module Crypto.Cipher.PKCS1_OAEP instead

SOLUTION

1
2
3
pip uninstall pycryptodome
pip uninstall pycrypto
pip install pycrypto

2018-12-28

ISSUE-dpkg删除/安装未完全安装的软件包

1
installed python-lockfile package post-installation script subprocess returned error exit status 127

SOLUTION

1
sudo apt-get install -f --reinstall coreutils init-system-helpers

2018-11-23

ISSUE-强制关闭Redis快照导致不能持久化

1
2
3
MISCONF Redis is configured to save RDB snapshots, but is currently not able to 
persist on disk. Commands that may modify the data set are disabled. Please
check Redis logs for details about the error.

SOLUTION

1
127.0.0.1:6379> config set stop-writes-on-bgsave-error no

2018-04-24

ISSUE

1
ValueError: Expecting property name enclosed in double quotes: line 1 column 2 (char 1)

SOLUTION

1
# 将json中的单引号改成双引号

2018-04-24

ISSUE

1
selenium.common.exceptions.InvalidSelectorException: Message: Compound class names not permitted

SOLUTION

1
在selenium元素定位中复合class,取一个class名即可

2018-04-28

ISSUE

1
Your password does not satisfy the current policy requirements

SOLUTION

1
2
3
SHOW VARIABLES LIKE 'validate_password%';
set global validate_password_policy=LOW;
ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';

2018-04-24

ISSUE

1
NameError: name '__main__' is not defined

SOLUTION

1
if __name__ == '__main__':

2018-02-22

ISSUE

1
2
3
4
5
>>> eval(a)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<string>", line 1, in <module>
NameError: name 'null' is not defined

SOLUTION

1
>>> json.loads(a)

2018-01-23

ISSUE

1
SyntaxError: Non-ASCII character '\xe4' in file

SOLUTION

1
2
# Python将ASCII作为默认的标准编码,要定义源代码编码,必须在源文件中第一行放置一个魔术注释
# -*- coding: utf-8 -*-

2017-12-30

ISSUE

1
Ubuntu安装包时报错 E:Unable to locate package xxx

SOLUTION

1
apt-get update

2017-08-06

ISSUE-refusing to merge unrelated histories

1
fatal: refusing to merge unrelated histories   

SOLUTION

1
git pull origin master --allow-unrelated-histories

2016-03-16

ISSUE-端口占用无法启动Apache

    
1
2
XAMPP: Starting Apache...fail.
XAMPP: Another web server is already running.

SOLUTION

1
2
3
in bash:
// killed Apache server that was pre-installed on MAC OS X.
sudo apachectl stop

2014-04-24

ISSUE

1
2
E/AndroidRuntime(439): Caused by: java.lang.ClassCastException: 
android.app

SOLUTION

  • 原因:应用的程序名称没指定具体的Application的类
  • 步骤
    • 在AndroidManifest.xml中的Application标签中添加名字
      <application android:name="com.shelling.ans.AnsApplication"
    • Progject->clean
    • 重新运行