4 Docker普通用户无权限
普通用户执行docker命令提示信息:
docker images
docker ps -a
docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post “http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/create?name=redis-module”: dial unix /var/run/docker.sock: connect: permission denied.
4.1 原因
当前用户不在Docker用户组。
4.2 方案
当前用户添加到用户组,由于只是个人操作的虚拟机,将当前用户添加到docker用户组。
$USER获取当前用户,如果是其他用户使用 $your-username。
# 添加用户组
sudo groupadd docker
# 主机用户添加到docker用户组
sudo gpasswd -a $USER docker
# 更新用户组
newgrp docker
3 Ubuntu22.04安装docker异常
Ubuntu22.04安装Docker出现如下异常,
因为,上次安装软件时使用了apt-get,中途中断安装。
sudo apt install docker.io
异常信息如下:
Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is hWaiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 1749 (unattended-upgr)
尝试删除文件:/var/lib/dpkg/lock-frontend
再次安装,异常信息如下:
E: Could not get lock /var/cache/apt/archives/lock. It is held by process 1749 (unattended-upgr)
N: Be aware that removing the lock file is not a solution and may break your system.
E: Unable to lock directory /var/cache/apt/archives/
再次删除相关文件:/var/cache/apt/archives/lock
即可正常安装。
3.1 原因
文件被中断的线程/服务占用,未被释放,无法读写。
3.2 方案
删除锁定的文件
sudo rm /var/lib/dpkg/lock-frontend
sudo rm /var/cache/apt/archives/lock
2 url内容解析
File “/app/src/utils/file_process_util.py”, line 66, in request_data_from_url
text = trafilatura.extract(source_data)
File “/usr/local/lib/python3.10/site-packages/trafilatura/core.py”, line 1050, in extract
signal(SIGALRM, timeout_handler)
File “/usr/local/lib/python3.10/signal.py”, line 56, in signal
handler = _signal.signal(_enum_to_int(signalnum), _enum_to_int(handler))
ValueError: signal only works in main thread of the main interpreter
2.1 方案
线上问题:FastAPI和trafilatura出现ValueError: signal only works in main thread of the main interpreter
https://blog.csdn.net/Xin_101/article/details/130313353
1 SpringBoot启动异常
14-04-2023 17:07:53 CST model_task INFO - 2023-04-14 17:07:53,379 [WARN] [main] Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘solrClient’ defined in class path resource [org/springframework/boot/autoconfigure/solr/SolrAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.solr.client.solrj.SolrClient]: Factory method ‘solrClient’ threw exception; nested exception is java.lang.NoClassDefFoundError: org/apache/solr/client/solrj/impl/HttpSolrClient$ Builder (org.springframework.context.annotation.AnnotationConfigApplicationContext(org.springframework.context.support.AbstractApplicationContext.refresh:557))
14-04-2023 17:07:53 CST model_task INFO - 2023-04-14 17:07:53,416 [ERROR] [rpc-server-4-7] Error while invoking RpcHandler#receive() for one-way message. (org.apache.spark.network.server.TransportRequestHandler(org.apache.spark.network.server.TransportRequestHandler.processOneWayMessage:276))
14-04-2023 17:07:53 CST model_task INFO - org.apache.spark.SparkException: Could not find CoarseGrainedScheduler.
14-04-2023 17:07:53 CST model_task INFO - at org.apache.spark.rpc.netty.Dispatcher.postMessage(Dispatcher.scala:178)
14-04-2023 17:07:53 CST model_task INFO - at org.apache.spark.rpc.netty.Dispatcher.postOneWayMessage(Dispatcher.scala:150)
14-04-2023 17:07:53 CST model_task INFO - at org.apache.spark.rpc.netty.NettyRpcHandler.receive(NettyRpcEnv.scala:690)
14-04-2023 17:07:53 CST model_task INFO - at org.apache.spark.network.server.TransportRequestHandler.processOneWayMessage(TransportRequestHandler.java:274)
14-04-2023 17:07:53 CST model_task INFO - at org.apache.spark.network.server.TransportRequestHandler.handle(TransportRequestHandler.java:111)
1.1 原因
缺少类:
1.2 方案
启动SpringBoot是排除该类。
@SpringBootApplication(exclude = SolrAutoConfiguration.class)
public class SearchApplication extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
return builder.sources(SearchApplication.class);
}
public static void main(String[] args) {
SpringApplication.run(SearchApplication.class, args);
}
}