手机浏览 RSS 2.0 订阅 膘叔的简单人生 , 腾讯云RDS购买 | 超便宜的Vultr , 注册 | 登陆
浏览模式: 标准 | 列表2022年10月14日的文章

Tunnel error on MacOS when installed as service

其实我一直在想,这个功能什么时候会被关掉。

 
开始:
用cloudflare tunnel的时候,从没想过会在macos上出问题,如果你直接cloudflared service install,不会运行,即使你sudo了也不会,因为这个运行的只是cloudflared,并不带任何参数。
需要在相应的plist下面加上<string>tunnel</string><string>run</string>才OK。
加之前需要先unload,然后再load。否则无效。
其他都与官方一致。
 
---
如果用sudo了。需要将~/.cloudflared/下的内容copy到/etc/cloudflared下面。如果不放心或者担心没权限,可以修改uuid.json,将路径改为/etc/cloudflared/。其他照旧
 
记得配合一下valet,因为valet tld之后,子域名的映射会比较方便。
而且valet也支持multi php version。
 
---EOF
 

git fetch --unshadow出现RPC failed

 远程操作家里的mac mini进行更新的时候,突然报错:

XML/HTML代码
  1. mini:Homebrew mini$ brew update  
  2. Warning: No available formula with the name "ca-certificates".  
  3. ==> Searching for similarly named formulae...  
  4. Error: No similarly named formulae found.  
  5. ==> Searching for a previously deleted formula (in the last month)...  
  6. Warning: homebrew/core is shallow clone. To get its complete history, run:  
  7.   git -C "$(brew --repo homebrew/core)" fetch --unshallow  
  8.   
  9. Error: No previously deleted formula found.  
  10. ==> Searching taps on GitHub...  
  11. Error: No formulae found in taps.  
  12. Error:  
  13.   homebrew-core is a shallow clone.  
  14. To `brew update`, first run:  
  15.   git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow  
  16. This command may take a few minutes to run due to the large size of the repository.  
  17. This restriction has been made on GitHub's request because updating shallow  
  18. clones is an extremely expensive operation due to the tree layout and traffic of  
  19. Homebrew/homebrew-core and Homebrew/homebrew-cask. We don't do this for you  
  20. automatically to avoid repeatedly performing an expensive unshallow operation in  
  21. CI systems (which should instead be fixed to not use shallow clones). Sorry for  
  22. the inconvenience!  
于是执行 git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow  ,然而执行下来还是:
XML/HTML代码
  1. error: RPC failed; HTTP 504 curl 22 The requested URL returned error: 504 Gateway Time-out  
  2. fatal: the remote end hung up unexpectedly  
 
然后我就用打开git trace进行查看:
XML/HTML代码
  1. GIT_TRACE=2 git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow  
  2. 10:29:28.798061 exec-cmd.c:139          trace: resolved executable path from Darwin stack: /Applications/Xcode.app/Contents/Developer/usr/bin/git  
  3. 10:29:28.798668 exec-cmd.c:236          trace: resolved executable dir: /Applications/Xcode.app/Contents/Developer/usr/bin  
  4. 10:29:28.799328 git.c:418               trace: built-in: git fetch --unshallow  
  5. 10:29:28.801482 run-command.c:643       trace: run_command: GIT_DIR=.git git-remote-https origin https://mirrors.ustc.edu.cn/homebrew-core.git  
  6. 10:29:28.812513 exec-cmd.c:139          trace: resolved executable path from Darwin stack: /Applications/Xcode.app/Contents/Developer/usr/libexec/git-core/git-remote-https  
  7. 10:29:28.813122 exec-cmd.c:236          trace: resolved executable dir: /Applications/Xcode.app/Contents/Developer/usr/libexec/git-core  
  8. 10:29:28.929816 run-command.c:643       trace: run_command: git fetch-pack --stateless-rpc --stdin --lock-pack --include-tag --thin --depth=2147483647 https://mirrors.ustc.edu.cn/homebrew-core.git/  
  9. 10:29:28.935164 exec-cmd.c:139          trace: resolved executable path from Darwin stack: /Applications/Xcode.app/Contents/Developer/usr/libexec/git-core/git  
  10. 10:29:28.935863 exec-cmd.c:236          trace: resolved executable dir: /Applications/Xcode.app/Contents/Developer/usr/libexec/git-core  
  11. 10:29:28.936585 git.c:418               trace: built-in: git fetch-pack --stateless-rpc --stdin --lock-pack --include-tag --thin --depth=2147483647 https://mirrors.ustc.edu.cn/homebrew-core.git/  
  12. error: RPC failed; HTTP 504 curl 22 The requested URL returned error: 504 Gateway Time-out  
  13. fatal: the remote end hung up unexpectedly  
这个。。--depth=2147483647,居然这么深?
查到了网上的方案,参考在这里:记录: homebrew-core is a shallow clone - 腾讯云开发者社区-腾讯云 (tencent.com),我按上面的操作,删除了homebrew-core,homebrew-cask,再进行upgrade,果然 正常了。
 
---
在非正常之前,做了不少操作,比如用官方的uninstall脚本清除了系统,然而也没有什么用。所幸,现在正常了。