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

Instructions to fix errors for temux : #78

Closed
Hinatara opened this issue Feb 9, 2025 · 3 comments
Closed

Instructions to fix errors for temux : #78

Hinatara opened this issue Feb 9, 2025 · 3 comments

Comments

@Hinatara
Copy link

Hinatara commented Feb 9, 2025

error : (/data/data/com.termux/files/usr/lib/ruby/gems/3.3.0/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/common/platform.rb:98:in read': Permission denied @ rb_sysopen - /proc/version (Errno::EACCES) from /data/data/com.termux/files/usr/lib/ruby/gems/3.3.0/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/common/platform.rb:98:in wsl?'
from /data/data/com.termux/files/usr/lib/ruby/gems/3.3.0/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/common/socket_poller.rb:65:in block in <class:SocketPoller>' from <internal:kernel>:90:in tap'
from /data/data/com.termux/files/usr/lib/ruby/gems/3.3.0/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/common/socket_poller.rb:63:in <class:SocketPoller>' from /data/data/com.termux/files/usr/lib/ruby/gems/3.3.0/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/common/socket_poller.rb:25:in module:WebDriver'
from /data/data/com.termux/files/usr/lib/ruby/gems/3.3.0/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/common/socket_poller.rb:24:in <module:Selenium>' from /data/data/com.termux/files/usr/lib/ruby/gems/3.3.0/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/common/socket_poller.rb:23:in <top (required)>'
from internal:/data/data/com.termux/files/usr/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb:136:in require' from <internal:/data/data/com.termux/files/usr/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in require'
from /data/data/com.termux/files/usr/lib/ruby/gems/3.3.0/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/common.rb:27:in <top (required)>' from <internal:/data/data/com.termux/files/usr/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in require'
from internal:/data/data/com.termux/files/usr/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb:136:in require' from /data/data/com.termux/files/usr/lib/ruby/gems/3.3.0/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver.rb:27:in <top (required)>'
from internal:/data/data/com.termux/files/usr/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb:136:in require' from <internal:/data/data/com.termux/files/usr/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in require'
from /data/data/com.termux/files/usr/lib/ruby/gems/3.3.0/gems/selenium-webdriver-3.142.7/lib/selenium-webdriver.rb:20:in <top (required)>' from <internal:/data/data/com.termux/files/usr/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in require'
from internal:/data/data/com.termux/files/usr/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb:136:in require' from /data/data/com.termux/files/usr/lib/ruby/gems/3.3.0/gems/XSpear-1.4.1/lib/XSpear.rb:9:in <top (required)>'
from internal:/data/data/com.termux/files/usr/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb:136:in require' from <internal:/data/data/com.termux/files/usr/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in require'
from /data/data/com.termux/files/usr/lib/ruby/gems/3.3.0/gems/XSpear-1.4.1/exe/XSpear:2:in <top (required)>' from /data/data/com.termux/files/usr/bin/XSpear:25:in load'
from /data/data/com.termux/files/usr/bin/XSpear:25:in `

' )

Copy link

github-actions bot commented Feb 9, 2025

Thank you for your first issue report :D

@Hinatara
Copy link
Author

Hinatara commented Feb 9, 2025

How to fix :

  • Step 1 : Use the command ( nano /data/data/com.termux/files/usr/lib/ruby/gems/3.3.0/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/common/platform.rb ).
  • Step 2: Find the command line ( wsl? )
    def wsl?
    return false unless linux? # Only continue if the system is Linux.
    File.read('/proc/version').include?('Microsoft') # Reading system files blocked by Termux.
  • Step 3: fix the code
    Enter like this :( def wsl?
    false # Always return false, do not check /proc/version
    end ) .

@Hinatara
Copy link
Author

Hinatara commented Feb 9, 2025

Error cause :

  • Why Does This Error Occur in Termux ?
    Termux (running on Android) blocks direct access to /proc/version, resulting in a Permission denied error.

The original code attempts to read /proc/version to check for the keyword "Microsoft" (a sign of WSL). However, Android is not WSL, so this check is unnecessary and causes the error in Termux.

  • Key Issue:

Termux restricts access to system files like /proc/version for security reasons.
The wsl? method tries to read this restricted file, triggering the Errno::EACCES exception.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant