尝试使用 perforce cli 客户端 (p4) 从存储库中检索文件。我有一个配置了适当值的 P4CONFIG=~/.p4config 文件。
当我尝试使用 p4 命令时,出现以下错误:
p4 login
Perforce client error:
Connect to server failed; check $P4PORT.
TCP connect to "ssl:fqdn.com:port" failed.
Servname not supported for ai_socktype
当我指定 p4 端口 (P4PORT) 时,该命令有效:p4 -p ${P4PORT} login
请注意,perforce 提供了额外的选项来提供额外的调试信息:p4 -p ${P4PORT} -vnet=5 -vrpc=5 login
最佳答案
检查 P4PORT 环境变量中的值。
echo ${P4PORT}
echo ${P4PORT} | od -c
grep P4PORT ~/.bashrc
还要检查 perforce 在您的 perforce 配置中检查的值,grep P4PORT ${P4CONFIG}
grep P4PORT ${P4CONFIG} | od -c
p4 set P4PORT
问题是配置文件中的 P4PORT 值有引号。 shell 会去掉引号,但(显然)perforce 不会在配置文件中去掉引号。
关于linux - 未提供显式端口选项时出现 Perforce 客户端 (p4) 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69384672/