termux / termux-api

Termux add-on app which exposes device functionality as API to command line programs.
https://f-droid.org/en/packages/com.termux.api/
2.35k stars 461 forks source link

run termux-job-scheduler error #573

Open cxyzzz opened 1 year ago

cxyzzz commented 1 year ago

Problem description

when i run termux-job-scheduler --script $HOME/job.sh --period-ms 9100000 ,Termux:Api got a Error in ResultReturner

the job.sh content is:

#/system/bin/sh
date >> ~/date.log

Steps to reproduce

Expected behavior

Additional information

Termux logfile:

Report Info

User Action: plugin execution command
Sender: ResultReturner
Report Timestamp: 2023-01-14 02:40:55.682 UTC

Termux:API Error

Error in ResultReturner:
java.io.IOException: Connection refused
    at android.net.LocalSocketImpl.connectLocal(Native Method)
    at android.net.LocalSocketImpl.connect(LocalSocketImpl.java:259)
    at android.net.LocalSocket.connect(LocalSocket.java:148)
    at com.termux.api.util.ResultReturner.lambda$returnData$0(ResultReturner.java:161)
    at com.termux.api.util.-$$Lambda$ResultReturner$1wMz46asegPELp1xyZuz-rva9E4.run(Unknown Source:8)
    at java.lang.Thread.run(Thread.java:920)

Termux:API App Info (Current)

APP_NAME: Termux:API
PACKAGE_NAME: com.termux.api
VERSION_NAME: 0.50.1+2c6674f
VERSION_CODE: 51
UID: 10293
TARGET_SDK: 28
IS_DEBUGGABLE_BUILD: true
SE_PROCESS_CONTEXT: u:r:untrusted_app_27:s0:c37,c257,c512,c768
SE_FILE_CONTEXT: u:object_r:app_data_file:s0:c37,c257,c512,c768
SE_INFO: default:targetSdkVersion=28:complete
APK_RELEASE: Github
SIGNING_CERTIFICATE_SHA256_DIGEST: B6DA01480EEFD5FBF2CD3771B8D1021EC791304BDD6C4BF41D3FAABAD48EE5E1

Termux App Info

APP_NAME: Termux
PACKAGE_NAME: com.termux
VERSION_NAME: 0.118.0
VERSION_CODE: 118
UID: 10293
TARGET_SDK: 28
IS_DEBUGGABLE_BUILD: true
SE_PROCESS_CONTEXT: u:r:untrusted_app_27:s0:c37,c257,c512,c768
SE_FILE_CONTEXT: u:object_r:app_data_file:s0:c37,c257,c512,c768
SE_INFO: default:targetSdkVersion=28:complete
TERMUX_APP_PACKAGE_MANAGER: -
TERMUX_APP_PACKAGE_VARIANT: -
APK_RELEASE: Github
SIGNING_CERTIFICATE_SHA256_DIGEST: B6DA01480EEFD5FBF2CD3771B8D1021EC791304BDD6C4BF41D3FAABAD48EE5E1

Device Info

Software

OS_VERSION: 4.19.157-perf-gb16f2a3bb6af
SDK_INT: 31
RELEASE: 12
ID: SKQ1.220303.001
DISPLAY: SKQ1.220303.001 test-keys
INCREMENTAL: 22.7.19
SECURITY_PATCH: 2022-07-01
IS_DEBUGGABLE: 0
IS_TREBLE_ENABLED: true
TYPE: user
TAGS: release-keys
MAX_PHANTOM_PROCESSES: - (Requires DUMP and PACKAGE_USAGE_STATS permission)
MONITOR_PHANTOM_PROCS: <unsupported>
DEVICE_CONFIG_SYNC_DISABLED: -

Hardware

MANUFACTURER: Xiaomi
BRAND: Redmi
MODEL: Redmi K30 Pro
PRODUCT: lmi
BOARD: lmi
HARDWARE: qcom
DEVICE: lmi
SUPPORTED_ABIS: arm64-v8a, armeabi-v7a, armeabi

cxyzzz commented 1 year ago

i try another script, the job scheduler was work, but can't use termux-job-scheduler -p show work job or cancel job,it's always show No script path given.

UnkwUsr commented 9 months ago

The same error java.io.IOException: Connection refused ... at ResultReturner.java:161 in termux-fingerprint: https://github.com/termux/termux-api/issues/607. Seems to be this is general api error?

cxyzzz commented 9 months ago

The same error java.io.IOException: Connection refused ... at ResultReturner.java:161 in termux-fingerprint: #607. Seems to be this is general api error?

termux-fingerprint -t 'Unlock' is working in my phone,maby you can try install Termux:API and get it auto run permission

UnkwUsr commented 9 months ago

@cxyzzz sorry, I've not tried fingerprint before, but now for me it works too, without errors. Strange. Originally I experience error with termux-job-scheduler (current issue we are in) and found that one more issue have exactly the same stacktrace, so noted about it. P.S. do you still have issue with termux-job-scheduler?

UnkwUsr commented 9 months ago

Update: for me termux-job-scheduler actually works (scripts are executed), despite the notification with error (which is just annoying, no other problems I see). Also this notification pops not constantly. I can execute exactly the same command with exactly the same script (in -s argument) and sometimes error notification pops, sometimes not.