Ticket #10218 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

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:
Action Needed: no action Verified: no
Deployments affected: Blocked By:
Blocking:

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

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/

Change History

Changed 4 years ago by Quozl

log of failed Read activity

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

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?

Changed 4 years ago by Quozl

  • next_action changed from reproduce to test in build
  • milestone changed from 1.0-software-update to 10.1.2

Changed 4 years ago by Quozl

  • keywords os301 added; os300 removed
  • next_action changed from test in build to diagnose

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/

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.

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

Changed 4 years ago by dsd

  • next_action changed from diagnose to package

looks good to me

Changed 4 years ago by dsd

  • next_action changed from package to test in build

sugar-toolkit-0.84.12 ready for testing in next build

Changed 4 years ago by Quozl

  • status changed from new to closed
  • next_action changed from test in build to no action
  • resolution set to fixed

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.