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

beta: java.lang.StringIndexOutOfBoundsException when uploading a picture #376

Closed
doits opened this issue Nov 9, 2016 · 1 comment · Fixed by #394
Closed

beta: java.lang.StringIndexOutOfBoundsException when uploading a picture #376

doits opened this issue Nov 9, 2016 · 1 comment · Fixed by #394

Comments

@doits
Copy link

doits commented Nov 9, 2016

Actual behaviour

2016/11/09 18:45:35
UploadFileOperation : Upload of /storage/emulated/0/nextcloud/tmp/user@host/IMG_20161105_145620.jpg to /IMG_20161105_145620.jpg: Unexpected exception: java.lang.StringIndexOutOfBoundsException: length=7; regionStart=0; regionLength=8 - length=7; regionStart=0; regionLength=8 Exception : java.lang.StringIndexOutOfBoundsException: length=7; regionStart=0; regionLength=8
	at java.lang.String.substring(String.java:1931)
	at com.owncloud.android.lib.resources.files.ChunkedUploadRemoteFileOperation.uploadFile(ChunkedUploadRemoteFileOperation.java:74)
	at com.owncloud.android.lib.resources.files.UploadRemoteFileOperation.run(UploadRemoteFileOperation.java:110)
	at com.owncloud.android.lib.common.operations.RemoteOperation.execute(RemoteOperation.java:136)
	at com.owncloud.android.operations.UploadFileOperation.run(UploadFileOperation.java:389)
	at com.owncloud.android.lib.common.operations.RemoteOperation.execute(RemoteOperation.java:136)
	at com.owncloud.android.operations.common.SyncOperation.execute(SyncOperation.java:93)
	at com.owncloud.android.files.services.FileUploader.uploadFile(FileUploader.java:931)
	at com.owncloud.android.files.services.FileUploader$ServiceHandler.handleMessage(FileUploader.java:876)
	at android.os.Handler.dispatchMessage(Handler.java:102)
	at android.os.Looper.loop(Looper.java:154)
	at android.os.HandlerThread.run(HandlerThread.java:61)

Steps to reproduce

  1. In nextcloud app, click on the "+"
  2. Select "Upload"
  3. Browse to the file, select it and click upload

Some other files upload fine, but this one and some others does not.

Environment data

Android version: 7.1

Stock or customized system: cyanogenmod 14.1

Nextcloud app version: beta-20161109

Nextcloud server version: 10.0.1

Logs

Web server error log

Nextcloud log (data/nextcloud.log)

2016/11/09 18:45:28
LogHistoryActivity : onPause() ending

2016/11/09 18:45:28
Preferences : onStart() starting

2016/11/09 18:45:28
Preferences : onResume() starting

2016/11/09 18:45:28
LogHistoryActivity : onStop() ending

2016/11/09 18:45:28
LogHistoryActivity : onDestroy() ending

2016/11/09 18:45:28
Preferences : onPause() ending

2016/11/09 18:45:29
Preferences : onSaveInstanceState(Bundle) starting

2016/11/09 18:45:29
Preferences : onStop() ending

2016/11/09 18:45:32
ReceiveExternalFilesActivity : onCreate(Bundle) starting

2016/11/09 18:45:32
ReceiveExternalFilesActivity : onStart() starting

2016/11/09 18:45:32
ReceiveExternalFilesActivity : Populating view with content of : /

2016/11/09 18:45:32
ReceiveExternalFilesActivity : onResume() starting

2016/11/09 18:45:32
DrawerActivity : setDrawerMenuItemChecked has been called with invalid menu-item-ID

2016/11/09 18:45:32
FileActivity : Operations service connected

2016/11/09 18:45:32
ReceiveExternalFilesActivity : Received broadcast com.owncloud.android.operations.RefreshFolderOperation.EVENT_SINGLE_FOLDER_CONTENTS_SYNCED

2016/11/09 18:45:32
ReceiveExternalFilesActivity : Populating view with content of : /

2016/11/09 18:45:32
ReceiveExternalFilesActivity : Setting progress visibility to true

2016/11/09 18:45:32
ReceiveExternalFilesActivity : Received broadcast com.owncloud.android.operations.RefreshFolderOperation.EVENT_SINGLE_FOLDER_SHARES_SYNCED

2016/11/09 18:45:32
ReceiveExternalFilesActivity : Populating view with content of : /

2016/11/09 18:45:32
ReceiveExternalFilesActivity : Setting progress visibility to false

2016/11/09 18:45:34
ReceiveExternalFilesActivity : Uploading file to dir /

2016/11/09 18:45:34
FileActivity : show loading dialog

2016/11/09 18:45:34
ReceiveExternalFilesActivity : onPause() ending

2016/11/09 18:45:34
FileUploader : Starting command with id 5

2016/11/09 18:45:34
UploadsStorageManager : Inserting /storage/emulated/0/nextcloud/tmp/user@host/IMG_20161105_145620.jpg with status=UPLOAD_IN_PROGRESS

2016/11/09 18:45:34
UploadsStorageManager : storeUpload returns with: content://org.nextcloud.beta.provider/uploads/5 for file: /storage/emulated/0/nextcloud/tmp/user@host/IMG_20161105_145620.jpg

2016/11/09 18:45:34
UploadsStorageManager : notifyObserversNow

2016/11/09 18:45:34
FileActivity : dismiss loading dialog

2016/11/09 18:45:34
UploadsStorageManager : Updating /storage/emulated/0/nextcloud/tmp/user@host/IMG_20161105_145620.jpg with status:UPLOAD_IN_PROGRESS and result:UNKNOWN (old:/storage/emulated/0/nextcloud/tmp/user@host/IMG_20161105_145620.jpg status:UPLOAD_IN_PROGRESS result:-1)

2016/11/09 18:45:34
UploadsStorageManager : Updating /storage/emulated/0/nextcloud/tmp/user@host/IMG_20161105_145620.jpg with status=UPLOAD_IN_PROGRESS

2016/11/09 18:45:34
UploadsStorageManager : updateUpload returns with: 1 for file: /storage/emulated/0/nextcloud/tmp/user@host/IMG_20161105_145620.jpg

2016/11/09 18:45:34
UploadsStorageManager : notifyObserversNow

2016/11/09 18:45:34
SimpleFactoryManager : getClientFor(OwnCloudAccount ... :

2016/11/09 18:45:34
OwnCloudClient #306 : Creating OwnCloudClient

2016/11/09 18:45:34
SimpleFactoryManager :     new client {user@host, 188219271}

2016/11/09 18:45:34
OwnCloudClient #306 : REQUEST HEAD /remote.php/webdav/

2016/11/09 18:45:34
ExistenceCheckRemoteOperation : Existence check for https://host/remote.php/webdav/ targeting for  existence finished with HTTP status 200

2016/11/09 18:45:34
UploadFileOperation : Checking name collision in server

2016/11/09 18:45:34
OwnCloudClient #306 : REQUEST HEAD /remote.php/webdav/IMG_20161105_145620.jpg

2016/11/09 18:45:34
ReceiveExternalFilesActivity : onStop() ending

2016/11/09 18:45:34
ReceiveExternalFilesActivity : onDestroy() ending

2016/11/09 18:45:35
ExistenceCheckRemoteOperation : Existence check for https://host/remote.php/webdav/IMG_20161105_145620.jpg targeting for  existence finished with HTTP status 404(FAIL)

2016/11/09 18:45:35
UploadsStorageManager : Updating /storage/emulated/0/nextcloud/tmp/user@host/IMG_20161105_145620.jpg with status:UPLOAD_IN_PROGRESS and result:UNKNOWN (old:/storage/emulated/0/nextcloud/tmp/user@host/IMG_20161105_145620.jpg status:UPLOAD_IN_PROGRESS result:-1)

2016/11/09 18:45:35
UploadsStorageManager : Updating /storage/emulated/0/nextcloud/tmp/user@host/IMG_20161105_145620.jpg with status=UPLOAD_IN_PROGRESS

2016/11/09 18:45:35
UploadsStorageManager : updateUpload returns with: 1 for file: /storage/emulated/0/nextcloud/tmp/user@host/IMG_20161105_145620.jpg

2016/11/09 18:45:35
UploadsStorageManager : notifyObserversNow

2016/11/09 18:45:35
UploadFileOperation : Upload of /storage/emulated/0/nextcloud/tmp/user@host/IMG_20161105_145620.jpg to /IMG_20161105_145620.jpg: Unexpected exception: java.lang.StringIndexOutOfBoundsException: length=7; regionStart=0; regionLength=8 - length=7; regionStart=0; regionLength=8 Exception : java.lang.StringIndexOutOfBoundsException: length=7; regionStart=0; regionLength=8
	at java.lang.String.substring(String.java:1931)
	at com.owncloud.android.lib.resources.files.ChunkedUploadRemoteFileOperation.uploadFile(ChunkedUploadRemoteFileOperation.java:74)
	at com.owncloud.android.lib.resources.files.UploadRemoteFileOperation.run(UploadRemoteFileOperation.java:110)
	at com.owncloud.android.lib.common.operations.RemoteOperation.execute(RemoteOperation.java:136)
	at com.owncloud.android.operations.UploadFileOperation.run(UploadFileOperation.java:389)
	at com.owncloud.android.lib.common.operations.RemoteOperation.execute(RemoteOperation.java:136)
	at com.owncloud.android.operations.common.SyncOperation.execute(SyncOperation.java:93)
	at com.owncloud.android.files.services.FileUploader.uploadFile(FileUploader.java:931)
	at com.owncloud.android.files.services.FileUploader$ServiceHandler.handleMessage(FileUploader.java:876)
	at android.os.Handler.dispatchMessage(Handler.java:102)
	at android.os.Looper.loop(Looper.java:154)
	at android.os.HandlerThread.run(HandlerThread.java:61)


2016/11/09 18:45:35
UploadsStorageManager : updateDataseUploadResult uploadResult: com.owncloud.android.lib.common.operations.RemoteOperationResult@a2df652 upload: com.owncloud.android.operations.UploadFileOperation@c0b0d23

2016/11/09 18:45:35
UploadsStorageManager : Updating /storage/emulated/0/nextcloud/tmp/user@host/IMG_20161105_145620.jpg with status:UPLOAD_FAILED and result:NETWORK_CONNECTION (old:/storage/emulated/0/nextcloud/tmp/user@host/IMG_20161105_145620.jpg status:UPLOAD_IN_PROGRESS result:-1)

2016/11/09 18:45:35
UploadsStorageManager : Updating /storage/emulated/0/nextcloud/tmp/user@host/IMG_20161105_145620.jpg with status=UPLOAD_FAILED

2016/11/09 18:45:35
UploadsStorageManager : updateUpload returns with: 1 for file: /storage/emulated/0/nextcloud/tmp/user@host/IMG_20161105_145620.jpg

2016/11/09 18:45:35
UploadsStorageManager : notifyObserversNow

2016/11/09 18:45:35
FileUploader : NotifyUploadResult with resultCode: HOST_NOT_AVAILABLE

2016/11/09 18:45:35
FileUploader : Stopping command after id 5

2016/11/09 18:45:35
SimpleFactoryManager : getClientFor(OwnCloudAccount ... :

2016/11/09 18:45:35
OwnCloudClient #307 : Creating OwnCloudClient

2016/11/09 18:45:35
SimpleFactoryManager :     new client {user@host, 7440345}

2016/11/09 18:45:37
Preferences : onStart() starting

2016/11/09 18:45:37
Preferences : onResume() starting

2016/11/09 18:45:38
Preferences : onPause() ending

2016/11/09 18:45:38
LogHistoryActivity : onCreate(Bundle) starting

2016/11/09 18:45:38
LogHistoryActivity : onStart() starting

2016/11/09 18:45:38
LogHistoryActivity : onResume() starting

2016/11/09 18:45:39
Preferences : onSaveInstanceState(Bundle) starting

2016/11/09 18:45:39
Preferences : onStop() ending
@AndyScherzinger
Copy link
Member

library fix has been put into lib release 1.0.9: https://github.com/nextcloud/android-library/releases/tag/1.0.9

with #394 being the PR integrating/referencing the lib release

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

Successfully merging a pull request may close this issue.

3 participants