2

Everything is working fine untill I decide to delete something, my hosting is back4app.com. I verified the security restrictions of my Database so it's ok I can write, read also delete objects, but when I try to delete an object by using e.g:

gameScore.delete();

I got an error like this:

Connection Error
There was a networking error in the connection to parseapi.back4app.com/....

I don't understand why, because I can do queries, update objects, create new objects and all, the only thing I can't do is deleting objects, why?

OBS: I'm using parse4cn1 API for Codename One framework and my hosting is back4app.com.

EDITED:

@ShaiAlmog Yes this is an android device, today my friends and I have figured out what is causing that issue, and it's related with android version, it worked fine in versions 6.0.1 and higher, but in versions such as 4.4.2, 4.2.2 and probably lower it doesn't work and won't work. Not sure if it's either a parse4cn1 API issue or a Codename One API issue, I couldn't debug it because I have no debugging skills, but anyways it's android version related. In my country those android versions are pretty much in use so most of my custumers also some of my friends with Codename One subscriptions are using those versions of android, we hopefully wait for an update if that issue is confirmed by your side.

Debugging log:

04-12 04:06:28.896: W/Conscrypt(2285): Could not set socket write timeout: java.lang.reflect.InvocationTargetException
04-12 04:06:28.896: W/Conscrypt(2285):  at java.lang.reflect.Method.invokeNative(Native Method)
04-12 04:06:28.896: W/Conscrypt(2285):  at java.lang.reflect.Method.invoke(Method.java:511)
04-12 04:06:28.896: W/Conscrypt(2285): Caused by: libcore.io.ErrnoException: setsockopt failed: EBADF (Bad file number)
04-12 04:06:28.896: W/Conscrypt(2285):  at libcore.io.Posix.setsockoptTimeval(Native Method)
04-12 04:06:28.896: W/Conscrypt(2285):  at libcore.io.ForwardingOs.setsockoptTimeval(ForwardingOs.java:120)
04-12 04:06:28.916: I/System.out(7079): showKeyboard false
04-12 04:06:28.996: D/hawaii.hwcomposer(1460): FBDevice::vsync called 65 times
04-12 04:06:29.006: D/hawaii.hwcomposer(1460): FBDevice::post called 7 times [7 0 0 0 0 0 0 0]
04-12 04:06:29.156: D/dalvikvm(7079): GC_CONCURRENT freed 1931K, 24% free 14689K/19148K, paused 2ms+12ms, total 53ms
04-12 04:06:29.226: D/Biblioteca Digital(7079): [EDT] 0:5:58,564 - Exception: java.net.ProtocolException - DELETE does not support writing
04-12 04:06:29.226: W/System.err(7079): java.net.ProtocolException: DELETE does not support writing
04-12 04:06:29.226: W/System.err(7079):     at libcore.net.http.HttpURLConnectionImpl.initHttpEngine(HttpURLConnectionImpl.java:249)
04-12 04:06:29.226: W/System.err(7079):     at libcore.net.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:79)
04-12 04:06:29.226: W/System.err(7079):     at libcore.net.http.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:197)
04-12 04:06:29.226: W/System.err(7079):     at libcore.net.http.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:281)
04-12 04:06:29.226: W/System.err(7079):     at com.codename1.impl.android.AndroidImplementation.openOutputStream(AndroidImplementation.java:4784)
04-12 04:06:29.226: W/System.err(7079):     at com.codename1.io.ConnectionRequest.performOperation(ConnectionRequest.java:674)
04-12 04:06:29.226: W/System.err(7079):     at com.codename1.io.NetworkManager$NetworkThread.run(NetworkManager.java:282)
04-12 04:06:29.226: W/System.err(7079):     at com.codename1.impl.CodenameOneThread$1.run(CodenameOneThread.java:60)
04-12 04:06:29.226: W/System.err(7079):     at java.lang.Thread.run(Thread.java:856)
Simple
  • 827
  • 1
  • 9
  • 21
  • Open the network monitor tool and look at the requests going back and forth. What's happening in the delete request. When you browse the database in the back4app website do you see the entry in the db? – Shai Almog Apr 09 '18 at 04:22
  • @ShaiAlmog Using the Simulator I can delete, but in my mobile it doesn't work, and the code is the same, that's weird. – Simple Apr 09 '18 at 13:33
  • 1
    Assuming an android device I would suggest connecting a cable and looking to see if there is an exception thrown or similar issue. You can use DDMS/logcat to view the output – Shai Almog Apr 10 '18 at 06:13
  • @ShaiAlmog My answer is too long for the character limit so I'll update my question with my answer. Check it out. – Simple Apr 10 '18 at 21:50
  • When you connect that older device to DDMS/logcat with a USB cable you should see output. Clear the console before the delete, press the delete button and copy the text from the logcat. Paste it here and I'll help you figure out if there is anything interesting there. – Shai Almog Apr 11 '18 at 04:16
  • @ShaiAlmog Edited my question with the debugging log as requested. – Simple Apr 12 '18 at 03:29
  • You've cut out a lot of the log including the start of the exception but it's clear there is a network response error on the device. Please retry but make sure to copy more from a bit before the exception statement all the way down. – Shai Almog Apr 12 '18 at 04:25
  • @ShaiAlmog Edited my question with more details. `java.net.ProtocolException: DELETE does not support writing` seems a relevant thing. – Simple Apr 12 '18 at 07:14

1 Answers1

1

It's a bug in Parse4cn1 I've created a pull request with the proposed fix for the maintainer of the project here: https://github.com/sidiabale/parse4cn1/pull/36

Shai Almog
  • 51,749
  • 5
  • 35
  • 65
  • Thank you very much for the solution, can you teach me how to update that in my parse4cn1.cn1lib? – Simple Apr 13 '18 at 13:43
  • 1
    Once seibel updates the cn1lib he should submit an update to us and you can just update through the Extension Manager in Codename One settings. – Shai Almog Apr 14 '18 at 04:04
  • I'll create a release a.s.a.p. – netsuite_insights Apr 17 '18 at 23:21
  • 1
    @Rafa The fix has been integrated in a new release which should be available via the Extension Manager in CodenameOne – netsuite_insights Apr 19 '18 at 02:30
  • @sidiabale Thanks for the fix, by the way take a look at this topic: https://stackoverflow.com/questions/49885112/proguard-server-build-error-codename-one Seems a bug related with `parse4cn1` with `Proguard` – Simple Apr 20 '18 at 15:57