Skip to content

EACCES (Permission denied) when livesync Angular projects on Samsung devices #2485

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

Closed
NickIliev opened this issue Feb 3, 2017 · 28 comments
Closed
Assignees
Milestone

Comments

@NickIliev
Copy link
Contributor

From @S4M37 on February 3, 2017 14:27

I'm using NativeScript 2.5.0 with Angular2, using android platform with building tool 25.0.2, I'm testing on a device, and tns doctor no issues are found. So my problem is when running 'tns run android' the app is launched but no changes are applied, here is the log

Project successfully prepared (android)
Transferring project files...
Unable to sync files. Error is: ENOENT: no such file or directory, stat 'C:\Users\S4M37\Desktop\CrossPlatform\project\platforms\android\src\main\assets\app\modules\feed\item\feed.item.css___jb_tm
p___'
02-03 15:16:18.512 5693 5693 W System.err: remove failed: EACCES (Permission denied) : /data/local/tmp/org.nativescript.project/sync/tns_modules/rxjs/src/MiscJSDoc.ts
02-03 15:16:18.532 5335 5335 E audit : type=1400 msg=audit(1486131378.512:526786): avc: denied { unlink } for pid=5693 comm="tivescript.project" name="MiscJSDoc.ts" dev="dm-1" ino=335142 s
context=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:shell_data_file:s0 tclass=file permissive=0
02-03 15:16:18.562 5693 5693 W System.err: remove failed: EACCES (Permission denied) : /data/local/tmp/org.nativescript.project/sync/tns_modules/rxjs/src/observable/dom/MiscJSDoc.ts
02-03 15:16:18.582 5335 5335 E audit : type=1400 msg=audit(1486131378.562:526982): avc: denied { unlink } for pid=5693 comm="tivescript.project" name="MiscJSDoc.ts" dev="dm-1" ino=335340 s
context=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:shell_data_file:s0 tclass=file permissive=0
JS: Angular 2 is running in the development mode. Call enableProdMode() to enable the production mode.
02-03 15:16:22.322 5693 5693 W ExifInterface: at com.tns.Runtime.callJSMethodNative(Native Method)

Copied from original issue: NativeScript/NativeScript#3569

@danieljohngomez
Copy link

Also experiencing this error after updating to 2.5

@ghost
Copy link

ghost commented Feb 5, 2017

Had the same problem. Removing and adding again the android platform fixed the error, but now the app crashes for the tiniest UI changes without any error. I have to restart the app every time to get it working again.

@S4M37
Copy link

S4M37 commented Feb 6, 2017

I had already tried removing the platform and re-adding it, but the problem still persisting.

@rhanb
Copy link

rhanb commented Feb 7, 2017

Same here ! Problem also occured without using Angular.

@RaphaelJenni
Copy link

+1

@Plamen5kov
Copy link
Contributor

@alpinparker @S4M37 @rhanbIT @RaphaelJenni, can you provide steps to reproduce. What devices are you using?

@RaphaelJenni
Copy link

Can't reproduce it. Happens from time to time and then I have to restart the app. (tns run android)
I'm using the android emulator. Haven't tried it on a physical device.

@Plamen5kov Plamen5kov added the bug label Feb 8, 2017
@RaphaelJenni
Copy link

Happened again:

Transferring project files...
Unable to sync files. Error is: ENOENT: no such file or directory, stat 'C:\_Projects\_NativeScript\project\platforms\android\src\main\assets\app\tns_modules\sharp\build\Release\obj\libvips-cpp\libvips-cpp.tlog\link-VCTIP.delete.93.tlog'

The folder sharp doesn't exist. Is sharp a necessary import? Added it now to the dependencies ("sharp": "^0.16.2"). I will keep you updated if it changes anything.

@S4M37
Copy link

S4M37 commented Feb 8, 2017

I'm testing on Samsung Galaxy S7, android 6.0.1
I run tns run android, it builds the app, installs it on device then after each changes the app is refreshed but without synchronizing files with the same error mentioned in the issue, to synchronize files I stop the processes and re-run tns run android.

@AbbeYassine
Copy link

same issue , testing on genymotion Google Nexus 7 API 22 emulator .

@rosen-vladimirov rosen-vladimirov self-assigned this Feb 10, 2017
@smarza
Copy link

smarza commented Feb 10, 2017

same here, using Samsung Note 7 device.

NativeScript Debugger started

[NSDebugAdapter] Ready to attach to application on 40000
[NSDebugAdapter] Connection to target application established on 40000
Executing before-watch hook from c:\SORTE\src\SORTE.Mobile\hooks\before-watch\nativescript-dev-typescript.js
Found peer TypeScript 2.1.5

02-10 12:30:28.051 22470 22470 W System.err: remove failed: EACCES (Permission denied) : /data/local/tmp/com.sortenasvendas.app/sync/tns_modules/lodash/fp/toJSON.js

02-10 12:30:28.091 6849 6849 E audit : type=1400 msg=audit(1486737028.051:404395): avc: denied { unlink } for pid=22470 comm="tenasvendas.app" name="toJSON.js" dev="sda17" ino=397221 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:shell_data_file:s0 tclass=file permissive=0

02-10 12:30:29.251 6849 6849 E audit : type=1400 msg=audit(1486737029.221:407491): avc: denied { unlink } for pid=22470 comm="tenasvendas.app" name="MiscJSDoc.ts" dev="sda17" ino=400321 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:shell_data_file:s0 tclass=file permissive=0

02-10 12:30:30.121 22470 22470 W System.err: remove failed: EACCES (Permission denied) : /data/local/tmp/com.sortenasvendas.app/sync/tns_modules/rxjs/src/MiscJSDoc.ts

02-10 12:30:30.151 6849 6849 E audit : type=1400 msg=audit(1486737030.121:409914): avc: denied { unlink } for pid=22470 comm="tenasvendas.app" name="MiscJSDoc.ts" dev="sda17" ino=402740 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:shell_data_file:s0 tclass=file permissive=0

02-10 12:30:30.181 22470 22470 W System.err: remove failed: EACCES (Permission denied) : /data/local/tmp/com.sortenasvendas.app/sync/tns_modules/rxjs/src/observable/dom/MiscJSDoc.ts

02-10 12:30:30.221 6849 6849 E audit : type=1400 msg=audit(1486737030.181:410108): avc: denied { unlink } for pid=22470 comm="tenasvendas.app" name="MiscJSDoc.ts" dev="sda17" ino=402936 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:shell_data_file:s0 tclass=file permissive=0
JS: Firebase.init done

@rosen-vladimirov rosen-vladimirov modified the milestone: 2.5.1 Feb 13, 2017
@rosen-vladimirov
Copy link
Contributor

Hey guys,
The issue reported by @S4M37 is in fact two separate issues.
The first one: Unable to sync files. Error is: ENOENT: no such file or directory, stat 'C:\Users\S4M37\Desktop\CrossPlatform\project\platforms\android\src\main\assets\app\modules\feed\item\feed.item.css___jb_tm p___' should be resolved with our incoming 2.5.1 release.

The other one:
02-03 15:16:18.562 5693 5693 W System.err: remove failed: EACCES (Permission denied) : /data/local/tmp/org.nativescript.project/sync/tns_modules/rxjs/src/observable/dom/MiscJSDoc.ts is something specific for some devices, I believe mostly Samsung ones. I'm still unable to reproduce it on my side, so most probably we'll release 2.5.1 without fix for this. Once we reproduce the problem, we'll provide a fix as soon as possible. In order to help us, can you please try reproducing the EACCESS error with tns run android --log trace and send us the output of the command when the error happened.
After that, try executing the following:

$ adb shell -s <device id>
$ cd /data/local/tmp/
$ ls -la
$ cd <app id> (for example `cd org.nativescript.project`)
$ ls -al
$ ls -al sync

and send us the output of all these commands. This will help us to detect the permissions of the files and to understand what migth cause this issue.

Thanks in advance for your help!

@ghost
Copy link

ghost commented Feb 18, 2017 via email

@rosen-vladimirov
Copy link
Contributor

Hey everyone,
We've released NativeScript 2.5.1, can you give it a try and see if it resolves your issues? In order to update your CLI's installation, please execute:

$ npm install -g nativescript@latest

I'm looking forward to hearing from you.

@S4M37
Copy link

S4M37 commented Feb 21, 2017

Thx, when updating to nativescript 2.5.1 the sync file issue is resolved for me. And thx for @Palak5034 too because his solution resolves the EACCES issues.

@rosen-vladimirov
Copy link
Contributor

Hey @S4M37 , can you give some information how did you resolve the EACCESS issue, so other users reading this thread will be able to find the solution as well.

@S4M37
Copy link

S4M37 commented Feb 21, 2017

I resolved it by editing the AndroidManifest.xml of the App_resources, by excluding the permission check for Android Api >18 with :
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="18"/>
according to @Palak5034 comment on this issue

@rhanb
Copy link

rhanb commented Feb 21, 2017

Fix the issue for me on Linux 😄

@dxshindeo
Copy link

Windows, CLI 2.5.2

tns run android --log trace
...
Successfully synced application org.test.app on device 32042064931e22df.

BeforeHookName for command watch is before-watch
Executing before-watch hook from C:\projects\Test\hooks\before-watch\nativescript-dev-typescript.js
Executing before-watch hook at location C:\projects\Test\hooks\before-watch\nativescript-dev-typescript.js in-process
Validating before-watch arguments.
Found peer TypeScript 2.1.6
C:\Program Files\nodejs\node.exe --max_old_space_size=4096 C:\projects\Test\node_modules\typescript\lib\tsc.js --project C:\projects\Test --watch --inlineSourceMap --inlineSources
Hook promises to signal completion
13:53:23 - Compilation complete. Watching for file changes.

Hook completed
03-17 13:53:27.109  3936  3936 W System.err: remove failed: EACCES (Permission denied) : /data/local/tmp/org.test.app/sync/tns_modules/nativescript-angular/node_modules/rxjs/src/MiscJSDoc.ts
03-17 13:53:27.274  3487  3487 E audit   : type=1400 msg=audit(1489751607.109:948223): avc:  denied  { unlink } for  pid=3936 comm="org.test.app" name="MiscJSDoc.ts" dev="mmcblk0p21" ino=335337 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:shell_data_file:s0 tclass=file
03-17 13:53:27.279  3487  3487 E audit   : type=1302 msg=audit(1489751607.109:948223): item=1 name="/data/local/tmp/org.test.app/sync/tns_modules/nativescript-angular/node_modules/rxjs/src/MiscJSDoc.ts" inode=335337 dev=103:0d mode=0100666 ouid=2000 ogid=2000 rdev=00:00 obj=u:object_r:shell_data_file:s0
03-17 13:53:27.824  3936  3936 W System.err: remove failed: EACCES (Permission denied) : /data/local/tmp/org.test.app/sync/tns_modules/nativescript-angular/node_modules/rxjs/src/observable/dom/MiscJSDoc.ts
03-17 13:53:28.004  3487  3487 E audit   : type=1400 msg=audit(1489751607.819:948416): avc:  denied  { unlink } for  pid=3936 comm="org.test.app" name="MiscJSDoc.ts" dev="mmcblk0p21" ino=335532 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:shell_data_file:s0 tclass=file
03-17 13:53:28.009  3487  3487 E audit   : type=1302 msg=audit(1489751607.819:948416): item=1 name="/data/local/tmp/org.test.app/sync/tns_modules/nativescript-angular/node_modules/rxjs/src/observable/dom/MiscJSDoc.ts" inode=335532 dev=103:0d mode=0100666 ouid=2000 ogid=2000 rdev=00:00 obj=u:object_r:shell_data_file:s0
03-17 13:53:34.879  3936  3936 W System.err: remove failed: EACCES (Permission denied) : /data/local/tmp/org.test.app/sync/tns_modules/rxjs/src/MiscJSDoc.ts
03-17 13:53:35.094  3487  3487 E audit   : type=1400 msg=audit(1489751614.869:949932): avc:  denied  { unlink } for  pid=3936 comm="org.test.app" name="MiscJSDoc.ts" dev="mmcblk0p21" ino=337866 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:shell_data_file:s0 tclass=file
03-17 13:53:35.099  3487  3487 E audit   : type=1302 msg=audit(1489751614.869:949932): item=1 name="/data/local/tmp/org.test.app/sync/tns_modules/rxjs/src/MiscJSDoc.ts" inode=337866 dev=103:0d mode=0100666 ouid=2000 ogid=2000 rdev=00:00 obj=u:object_r:shell_data_file:s0
03-17 13:53:35.719  3936  3936 W System.err: remove failed: EACCES (Permission denied) : /data/local/tmp/org.test.app/sync/tns_modules/rxjs/src/observable/dom/MiscJSDoc.ts
03-17 13:53:35.974  3487  3487 E audit   : type=1400 msg=audit(1489751615.714:950125): avc:  denied  { unlink } for  pid=3936 comm="org.test.app" name="MiscJSDoc.ts" dev="mmcblk0p21" ino=338061 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:shell_data_file:s0 tclass=file
03-17 13:53:35.979  3487  3487 E audit   : type=1302 msg=audit(1489751615.714:950125): item=1 name="/data/local/tmp/org.test.app/sync/tns_modules/rxjs/src/observable/dom/MiscJSDoc.ts" inode=338061 dev=103:0d mode=0100666 ouid=2000 ogid=2000 rdev=00:00 obj=u:object_r:shell_data_file:s0
...

Afterwards can't get past this one:

adb shell -s 32042064931e22df

/system/bin/sh: /system/bin/sh: - : unknown option

@jwuliger
Copy link

I can report the same issue. I am running into it now:

AfterHookName for command livesync is after-livesync
03-19 08:26:40.274 19346 19346 W System.err: remove failed: EACCES (Permission denied) : /data/local/tmp/com.pame.payroll/sync/tns_modules/rxjs/src/MiscJSDoc.ts

I can't seem to get around it. I am running and building on Windows 10.

@pkoleva pkoleva added this to the 3.0.0-RC milestone Mar 27, 2017
@pkoleva
Copy link
Contributor

pkoleva commented Mar 30, 2017

Hey all, would you try our 3.0 RC (nativescript@rc) release and check if you still experience these problems and if so write back with specific steps to reproduce.
@jwuliger @dxshindeo @smarza @AbbeYassine @danieljohngomez @RaphaelJenni

@ferryfax
Copy link

I was getting this error so I installed the 3.0 RC on Windows 10. I then created a new project using the tns create MyApp --template tns-template-hello-world-ng@rc command. Still got the same error with tns run android on my Galaxy S6. Doesn't seem to stop the app from running. Only does this on my phone, the emulator is fine.

03-30 21:48:36.604 26548 26548 W System.err: remove failed: EACCES (Permission denied) : /data/local/tmp/org.nativescript.Wisps/sync/tns_modules/rxjs/src/MiscJSDoc.ts
03-30 21:48:36.624  6857  6857 E audit   : type=1400 msg=audit(1490932116.604:46392): avc:  denied  { unlink } for  pid=26548 comm="ivescript.Wisps" name="MiscJSDoc.ts" dev="sda21" ino=337123 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:shell_data_file:s0 tclass=file permissive=0
03-30 21:48:36.664 26548 26548 W System.err: remove failed: EACCES (Permission denied) : /data/local/tmp/org.nativescript.Wisps/sync/tns_modules/rxjs/src/observable/dom/MiscJSDoc.ts
03-30 21:48:36.674  6857  6857 E audit   : type=1400 msg=audit(1490932116.664:46585): avc:  denied  { unlink } for  pid=26548 comm="ivescript.Wisps" name="MiscJSDoc.ts" dev="sda21" ino=337312 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:shell_data_file:s0 tclass=file permissive=0

@pkoleva pkoleva removed this from the 3.0.0-RC milestone Apr 3, 2017
@pkoleva pkoleva closed this as completed Apr 5, 2017
@pkoleva pkoleva reopened this Apr 5, 2017
@dtopuzov
Copy link
Contributor

dtopuzov commented Apr 24, 2017

I can confirm what @ferryfax says.
It happens only on some Samsung devices and it does not stop lives sync, it is just error on console.

@dtopuzov dtopuzov changed the title Nativescript 2.5.0 can't synchronize changes into device, ENOENT and EACCES errors EACCES (Permission denied) when livesync Angular projects on Samsung devices Apr 24, 2017
@etabakov etabakov added this to the 3.1.0 milestone Apr 27, 2017
@yyosifov yyosifov removed their assignment May 22, 2017
@pkoleva pkoleva removed this from the 3.1.0 milestone Jun 6, 2017
@Plamen5kov Plamen5kov self-assigned this Aug 3, 2017
@Plamen5kov
Copy link
Contributor

@ferryfax please give it a try with latest cli: npm install -g nativescript@next

@dtopuzov
Copy link
Contributor

dtopuzov commented Aug 18, 2017

@Plamen5kov Here is what happens with @next

Project successfully prepared (Android)
Successfully transferred app.css.
Refreshing application...
System.err: remove failed: EACCES (Permission denied) : /data/local/tmp/org.nativescript.TestApp/sync/app.css
System.err: remove failed: EACCES (Permission denied) : /data/local/tmp/org.nativescript.TestApp/sync
System.err: remove failed: ENOENT (No such file or directory) : /data/local/tmp/org.nativescript.TestApp/removedsync
Successfully synced application org.nativescript.TestApp on device 0715f791139b1a36.
Preparing project...
Project successfully prepared (Android)
Successfully transferred main-view-model.js.
Refreshing application...
System.err: remove failed: EACCES (Permission denied) : /data/local/tmp/org.nativescript.TestApp/sync/main-view-model.js
System.err: remove failed: EACCES (Permission denied) : /data/local/tmp/org.nativescript.TestApp/sync
System.err: remove failed: ENOENT (No such file or directory) : /data/local/tmp/org.nativescript.TestApp/removedsync
ActivityManager: Killing 15255:org.nativescript.TestApp/u0a1261 (adj 0): stop org.nativescript.TestApp cause from pid 15770
ActivityManager: cleanUpApplicationRecord -- 15255
Successfully synced application org.nativescript.TestApp on device 0715f791139b1a36.
Preparing project...
Project successfully prepared (Android)
Successfully transferred main-view-model.js.
Refreshing application...
System.err: remove failed: EACCES (Permission denied) : /data/local/tmp/org.nativescript.TestApp/sync/main-view-model.js
System.err: remove failed: EACCES (Permission denied) : /data/local/tmp/org.nativescript.TestApp/sync
System.err: remove failed: ENOENT (No such file or directory) : /data/local/tmp/org.nativescript.TestApp/removedsync
System.err: com.tns.NativeScriptException: 
System.err: Calling js method run failed
System.err: TypeError: Cannot set property '_modal' of null
System.err: File: "file:///data/data/org.nativescript.TestApp/files/app/tns_modules/tns-core-modules/ui/page/page-common.js, line: 211, column: 22
System.err: StackTrace: 
System.err: 	Frame: function:'PageBase._showNativeModalView', file:'file:///data/data/org.nativescript.TestApp/files/app/tns_modules/tns-core-modules/ui/page/page-common.js', line: 211, column: 23
System.err: 	Frame: function:'Page._showNativeModalView', file:'file:///data/data/org.nativescript.TestApp/files/app/tns_modules/tns-core-modules/ui/page/page.js', line: 112, column: 47
System.err: 	Frame: function:'PageBase.showModal', file:'file:///data/data/org.nativescript.TestApp/files/app/tns_modules/tns-core-modules/ui/page/page-common.js', line: 172, column: 18
System.err: 	Frame: function:'', file:'file:///data/data/org.nativescript.TestApp/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js', line: 24, column: 25
System.err: 	Frame: function:'invoke', file:'file:///data/data/org.nativescript.TestApp/files/app/tns_modules/tns-core-modules/timer/timer.js', line: 19, column: 48
System.err: 	Frame: function:'run', file:'file:///data/data/org.nativescript.TestApp/files/app/tns_modules/tns-core-modules/timer/timer.js', line: 23, column: 13
System.err: 	at com.tns.Runtime.callJSMethodNative(Native Method)
System.err: 	at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1043)
System.err: 	at com.tns.Runtime.callJSMethodImpl(Runtime.java:925)
System.err: 	at com.tns.Runtime.callJSMethod(Runtime.java:912)
System.err: 	at com.tns.Runtime.callJSMethod(Runtime.java:896)
System.err: 	at com.tns.Runtime.callJSMethod(Runtime.java:888)
System.err: 	at com.tns.gen.java.lang.Runnable.run(Runnable.java:10)
System.err: 	at android.os.Handler.handleCallback(Handler.java:739)
System.err: 	at android.os.Handler.dispatchMessage(Handler.java:95)
System.err: 	at android.os.Looper.loop(Looper.java:158)
System.err: 	at android.app.ActivityThread.main(ActivityThread.java:7229)
System.err: 	at java.lang.reflect.Method.invoke(Native Method)
System.err: 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
System.err: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
ActivityManager: Process org.nativescript.TestApp (pid 15809)(adj 0) has died(74,1237)
ActivityManager: cleanUpApplicationRecord -- 15809
Successfully synced application org.nativescript.TestApp on device 0715f791139b1a36.

It looks livesync works (at least in basic scenarios), but we still log a log of errors.

Tested with:

@Plamen5kov
Copy link
Contributor

@dtopuzov can you give me the steps to reproduce and the API level and model of the device you tested on.

@dtopuzov
Copy link
Contributor

@Plamen5kov Galaxy S6 Edge, Android 6.0

Steps:

tns create TestApp
tns run android
change app.css (change theme from light to dark)
change main-view-model.js (replace counter from 42 to 52)

@rosen-vladimirov
Copy link
Contributor

The new LiveSync with sockets, that will be used in CLI 4.2.0 will resolve this issue.
In order to give it a try, you need both latest CLI and latest android runtime.

@endarova endarova self-assigned this Aug 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests