Opened 4 years ago

Closed 4 years ago

#10218 closed defect (fixed)

XO-1 os300 Read from USB stick using object chooser fails

Reported by: Quozl Owned by: erikos
Priority: low Milestone: 10.1.2
Component: read-activity Version: Development build as of this date
Keywords: os301 Cc:
Blocked By: Blocking:
Deployments affected: Action Needed: no action
Verified: no

Description

Scenario: a PDF file on USB stick.

What fails: insert USB stick, start Read (F3, Ctrl/2, Click), on object chooser click on USB stick icon, click on PDF file. Read terminates and launcher times out.

What works: insert USB stick, view Journal, select USB stick, click on PDF file. Read is launched and displays the content.

Attachments (4)

org.laptop.sugar.ReadActivity-1.log (2.2 KB) - added by Quozl 4 years ago.
log of failed Read activity
Read-87.log (6.0 KB) - added by mikus 4 years ago.
os300 - log of successful Read activity
Read-86.log (6.7 KB) - added by mikus 4 years ago.
os206 - log of successful Read activity
logs.tar.bz2 (2.4 KB) - added by Quozl 4 years ago.
complete .sugar/default/logs after reproducing symptom, unpacks as logs/

Download all attachments as: .zip

Change History (15)

Changed 4 years ago by Quozl

log of failed Read activity

comment:1 Changed 4 years ago by mikus

Scenario: Put .pdf file on USB stick. Started Read; on object chooser click on USB stick icon, click on PDF file. Read displays content of PDF file. Did this both on os300 (Read-87) and os206 (Read-86).

Changed 4 years ago by mikus

os300 - log of successful Read activity

Changed 4 years ago by mikus

os206 - log of successful Read activity

comment:2 Changed 4 years ago by dsd

Can't reproduce either. Also this looks identical to #9953 which it looks like we fixed. James, can you double check and/or investigate further?

comment:3 Changed 4 years ago by Quozl

  • Action Needed changed from reproduce to test in build
  • Milestone changed from 1.0-software-update to 10.1.2

comment:4 Changed 4 years ago by Quozl

  • Action Needed changed from test in build to diagnose
  • Keywords os301 added; os300 removed

Repeated test, symptom still occurs.

Sequence was:

  • reflash XO-1 with os301.img,
  • prepare USB stick with a PDF file,
  • enter Sugar nick and choose colour,
  • wait for activity ring to appear,
  • insert USB stick,
  • start Read (F3, Ctrl/2, Click),
  • on object chooser click on USB stick icon,
  • click on PDF file. Read terminates and launcher times out.

Logs captured again, no change from previous log captured, still caused by an OSError Errno 2 No such file or directory exception from os.symlink in datastore.py.

Changed 4 years ago by Quozl

complete .sugar/default/logs after reproducing symptom, unpacks as logs/

comment:5 Changed 4 years ago by erikos

  • Owner changed from morgs to erikos

I can reproduce the issue (it is not the same one as #9953). You can only reproduce it with a fresh system (no activity has been run yet).

The error we are seeing is that the '(env.get_profile_path(), 'data'))' does not exist yet at that time. It gets created when an activity like Browse or Terminal has been run for the first time or you start Read by resuming the file on the external device. The issue is not read specific, same is true for Memorize when you use the object chooser in the create tab and try to open an image from the external device.

I will see what fix is best here and come up with a patch.

comment:6 Changed 4 years ago by erikos

This patch for sugar-toolkit will do.

diff --git a/src/sugar/datastore/datastore.py b/src/sugar/datastore/datastore.py
index 637c083..be272cc 100644
--- a/src/sugar/datastore/datastore.py
+++ b/src/sugar/datastore/datastore.py
@@ -214,9 +214,11 @@ class RawObject(object):
         # to create hardlinks to jobject files
         # and w/o this, it wouldn't work since we have file from mounted device
         if self._file_path is None:
+            data_path = os.path.join(env.get_profile_path(), 'data')
             self._file_path = tempfile.mktemp(
-                    prefix='rawobject',
-                    dir=os.path.join(env.get_profile_path(), 'data'))
+                    prefix='rawobject', dir=data_path)
+            if not os.path.exists(data_path):
+                os.makedirs(data_path)
             os.symlink(self.object_id, self._file_path)
         return self._file_path

comment:7 Changed 4 years ago by dsd

  • Action Needed changed from diagnose to package

looks good to me

comment:10 Changed 4 years ago by dsd

  • Action Needed changed from package to test in build

sugar-toolkit-0.84.12 ready for testing in next build

comment:11 Changed 4 years ago by Quozl

  • Action Needed changed from test in build to no action
  • Resolution set to fixed
  • Status changed from new to closed

Tested on os851 freshly installed on XO-1.5, test case passes fine.
Also verified patched code is present.

Note: See TracTickets for help on using tickets.