Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When install some_pod,error: ArgumentError - too long unix socket path (115bytes given but 104bytes max) #11640

Closed
Juice007 opened this issue Nov 2, 2022 · 8 comments · Fixed by #12158 or #12349

Comments

@Juice007
Copy link

Juice007 commented Nov 2, 2022

Report

What did you do?

Run pod install

What did you expect to happen?

Install all pod dependencies correctly.

What happened instead?

Error installing some_pod
ArgumentError - too long unix socket path (115bytes given but 104bytes max)

CocoaPods Environment

CocoaPods : 1.11.2
Ruby : ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-darwin21]
RubyGems : 3.1.4
Host : macOS 13.0 (22A380)
Xcode : 14.1 (14B47b)
Git : git version 2.38.1
Ruby lib dir : /Users/juice/.rvm/rubies/ruby-2.7.2/lib

@fkoner
Copy link

fkoner commented Nov 5, 2022

The same happens with this configuration:

CocoaPods : 1.11.3
Ruby : ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [arm64-darwin21]
RubyGems : 3.3.25
Host : macOS 12.6.1 (21G217)
Xcode : 13.2.1 (13C100)
Git : git version 2.38.1
Ruby lib dir : /Users/username/.rbenv/versions/3.1.2/lib

I have tried various approaches:

  • Installed cocoapods from gem
  • Installed cocoapods from brew
  • Installed different version of ruby using rbenv

This is the stack trace when running

Fetching external sources
-> Pre-downloading: `POD-NAME` from `git@github.com:organization/POD-NAME`, tag `current`
 > Git download
 > Git download
     $ /opt/homebrew/bin/git clone git@github.com:organization/POD-NAME /var/folders/2y/53c5cml9471b85dh93sfrt500000gp/T/d20221104-55107-i30thj --template= --single-branch --depth 1 --branch current
     Cloning into '/var/folders/2y/53c5cml9471b85dh93sfrt500000gp/T/d20221104-55107-i30thj'...

[!] Error installing POD-NAME
[!] Failed to download 'POD-NAME': too long unix socket path (132bytes given but 104bytes max)

/Users/username/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/external_sources/abstract_external_source.rb:120:in `rescue in block in pre_download'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/external_sources/abstract_external_source.rb:115:in `block in pre_download'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:86:in `titled_section'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/external_sources/abstract_external_source.rb:113:in `pre_download'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/external_sources/downloader_source.rb:13:in `fetch'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:993:in `fetch_external_source'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:972:in `block (2 levels) in fetch_external_sources'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:971:in `each'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:971:in `block in fetch_external_sources'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:64:in `section'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:970:in `fetch_external_sources'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:117:in `analyze'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:416:in `analyze'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:241:in `block in resolve_dependencies'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:64:in `section'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:240:in `resolve_dependencies'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:161:in `install!'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/command/install.rb:52:in `run'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/command.rb:52:in `run'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/bin/pod:55:in `<top (required)>'
/Users/username/.rbenv/versions/3.1.2/bin/pod:25:in `load'
/Users/username/.rbenv/versions/3.1.2/bin/pod:25:in `<main>'

With a ruby version 2.6.1 and cocoapods installed from gem we got this error:

Error installing POD-NAME
Failed to download 'POD-NAME': cannot handle socket

@fkoner
Copy link

fkoner commented Nov 5, 2022

It seems the error is in the fileutils lib, in this fileutils#1381.

/Users/username/.rbenv/versions/3.1.2/lib/ruby/3.1.0/fileutils.rb:1384:in `initialize'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/3.1.0/fileutils.rb:1384:in `new'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/3.1.0/fileutils.rb:1384:in `copy'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/3.1.0/fileutils.rb:490:in `block in copy_entry'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/3.1.0/fileutils.rb:1496:in `wrap_traverse'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/3.1.0/fileutils.rb:1499:in `block in wrap_traverse'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/3.1.0/fileutils.rb:1498:in `each'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/3.1.0/fileutils.rb:1498:in `wrap_traverse'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/3.1.0/fileutils.rb:1499:in `block in wrap_traverse'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/3.1.0/fileutils.rb:1498:in `each'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/3.1.0/fileutils.rb:1498:in `wrap_traverse'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/3.1.0/fileutils.rb:487:in `copy_entry'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/3.1.0/fileutils.rb:461:in `block in cp_r'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/3.1.0/fileutils.rb:1580:in `block in fu_each_src_dest'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/3.1.0/fileutils.rb:1596:in `fu_each_src_dest0'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/3.1.0/fileutils.rb:1578:in `fu_each_src_dest'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/3.1.0/fileutils.rb:460:in `cp_r'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/downloader/cache.rb:298:in `block in copy_and_clean'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/downloader/cache.rb:132:in `lock'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/downloader/cache.rb:99:in `write_lock'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/downloader/cache.rb:294:in `copy_and_clean'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/downloader/cache.rb:247:in `block (2 levels) in uncached_pod'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/downloader/cache.rb:245:in `each'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/downloader/cache.rb:245:in `block in uncached_pod'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/downloader/cache.rb:269:in `in_tmpdir'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/downloader/cache.rb:241:in `uncached_pod'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/downloader/cache.rb:33:in `download_pod'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/downloader.rb:42:in `download'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/external_sources/abstract_external_source.rb:116:in `block in pre_download'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:86:in `titled_section'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/external_sources/abstract_external_source.rb:113:in `pre_download'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/external_sources/downloader_source.rb:13:in `fetch'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:993:in `fetch_external_source'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:972:in `block (2 levels) in fetch_external_sources'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:971:in `each'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:971:in `block in fetch_external_sources'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:64:in `section'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:970:in `fetch_external_sources'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:117:in `analyze'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:416:in `analyze'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:241:in `block in resolve_dependencies'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:64:in `section'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:240:in `resolve_dependencies'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:161:in `install!'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/command/install.rb:52:in `run'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/command.rb:52:in `run'
/Users/username/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/bin/pod:55:in `<top (required)>'
/Users/username/.rbenv/versions/3.1.2/bin/pod:25:in `load'
/Users/username/.rbenv/versions/3.1.2/bin/pod:25:in `<main>'

@fkoner
Copy link

fkoner commented Nov 5, 2022

It seems that this path is too long:

/Users/username/Library/Caches/CocoaPods/Pods/External/POD-NAME/383e2d8dbad244b946c707aec67c52c9/.git/fsmonitor--daemon.ipc

@fkoner
Copy link

fkoner commented Nov 5, 2022

Related to ruby's socket implementation
https://github.com/ruby/ruby/blob/v3_1_2/ext/socket/socket.c#L1403

@fkoner
Copy link

fkoner commented Nov 5, 2022

Hi @Juice007
In my case, it was related to the git version (same as yours 2.38.1) and this global configuration core.fsmonitor it was set to true more info

~/.gitconfig file

[core]
        fsmonitor = true

When I disabled it, it ran smoothly

You can disable like this

git config --global core.fsmonitor false

Or modifying the ~/.gitconfig file

[core]
        fsmonitor = false

IDK if you have the same git configuration as mine.

I am wondering if there is a way cocoapods can deal with this.

@Juice007
Copy link
Author

Juice007 commented Nov 6, 2022

@fkoner Thanks a lot,It works!!!

@lptr
Copy link

lptr commented Apr 21, 2023

Disabling fsmonitor fixed it for me, too!

@justinseanmartin
Copy link
Contributor

justinseanmartin commented Nov 21, 2023

There is still an underlying problem here in CocoaPods. I narrowed this down in my case to this line. When I halt just before this and try to reproduce it manually from the command line, I get a more descriptive error back from cp:

/tmp/foo > cp -r src ~/Library/Caches/CocoaPods/Pods/External/repo/abcd1234abcd1234abcd1234abcd1234
cp: src/.git/fsmonitor--daemon.ipc is a socket (not copied).

This indicates an issue with this one specific file that FileUtils.cp_r is trying to copy. This issue was obviated for podspecs without a prepare_command by this change that @dnkoutso landed yesterday, but it could still happen for podspecs with prepare_command. I'll put up a proposal for a fix for this issue shortly.

justinseanmartin added a commit to justinseanmartin/CocoaPods that referenced this issue Nov 21, 2023
This prevents a copy error where the system is unable to copy the ipc
file due to being a socket. This would otherwise manifest as errors
during pod install with the message "too long unix socket path" if git's
`core.fsmonitor` feature is enabled.

Resolves CocoaPods#11640
justinseanmartin added a commit to justinseanmartin/CocoaPods that referenced this issue Nov 21, 2023
This prevents a copy error where the system is unable to copy the ipc
file due to being a socket. This would otherwise manifest as errors
during pod install with the message "too long unix socket path" if git's
`core.fsmonitor` feature is enabled.

Resolves CocoaPods#11640
justinseanmartin added a commit to justinseanmartin/CocoaPods that referenced this issue Nov 22, 2023
This prevents a copy error where the system is unable to copy the ipc
file due to being a socket. This would otherwise manifest as errors
during pod install with the message "too long unix socket path" if git's
`core.fsmonitor` feature is enabled.

Resolves CocoaPods#11640
justinseanmartin added a commit to justinseanmartin/CocoaPods that referenced this issue Nov 22, 2023
This prevents a copy error where the system is unable to copy the ipc
file due to being a socket. This would otherwise manifest as errors
during pod install with the message "too long unix socket path" if git's
`core.fsmonitor` feature is enabled.

Resolves CocoaPods#11640
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants