| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
Add compute_md5 function in src/utils/fs.py
Remove identical md5 functions from src/live/ogOperations.py and
src/utils/tiptorrent.py
Move error checks from ogOperations.py into compute_md5 function in
src/utils/fs.py
|
|
|
|
| |
tip_client_get() needs f-string to display error
|
| |
|
|
|
|
|
|
|
| |
logging.warn() is deprecated since 3.3.
And use .error() instead when command is unsupported or client is busy, that
should not ever happen.
|
|
|
|
|
| |
if image file and checksum are not found in the cache, then report checksum
validation has failed so it can proceed to fetch new files from server.
|
|
|
|
|
|
|
| |
Restoring an updated image file (with different checksum) could fail while the
old checksum file could remain in place.
Remove image and checksum file before fetching the new files.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
.full.sum file in the local cache contains the local checksum for this file,
this checksum is calculated by tip_write_csum(), therefore, there is no need to
calculate this checksum again from the image file in the cache, use this
checksum content instead.
if .full.sum is not available, then cache is inconsistent, tip_check_csum()
is called after checking if image file exists, raise an exception.
checksum could mismatch in two situations:
a) new image version (checksum is different)
b) image is corrupted
in both cases, a new fresh image needs to be retrieved.
this speeds up checksum validation.
|
|
|
|
| |
display checksum for server and local file when checksum mismatches.
|
|
|
|
| |
Move log message to function that is called both by unicast and tiptorrent.
|
|
|
|
|
|
|
|
| |
When checksum is not available, it displays:
(2024-07-15 09:04:14) ogClient: [ERROR] - URL error when fetching checksum: Not Found
"URL error" is leaking an internal implementation details, reword this report.
|
|
|
|
|
|
|
|
| |
Add explicit check for .full.sum after downloading it.
Rewrite errors log, one of them is misleading when checksum validation
fails, it refers to missing .full.sum, but it could be a different
reason.
|
|
|
|
|
|
| |
Use the constant OG_CACHE_IMAGE_PATH from cache.py to obtain the
location of the directory where images are stored.
This way the path can be changed from one single point.
|
|
|
|
|
|
| |
Remove old TODO message.
Check if the cache is available before trying to generate an
image's checksum.
|
|
|
|
|
| |
Add a check for potential permission or IO errors during the
creation of the image checksum.
|
|
|
|
| |
Display if checksum validation is correct or not.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Log an error message in known error cases and log a backtrace
otherwise.
Define a new error type OgError to be used in all the 'raise'
blocks to define the error message to log. The exception
propagates until it reaches send_internal_server_error() where
the exception type is checked. If the type is OgError we log
the exception message. Logs the backtrace for other types.
The initial error implementation printed a backtrace everytime
an error ocurred. The next iteration changed it to only print
a backtrace in a very particular case but ended up omiting too
much information such as syntax errors or unknown error context.
The actual implementation only logs the cases we already cover in
the codebase and logs a bracktrace in the others, enabling a
better debugging experience.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use only the exception messages as the main resource for error
messages.
The previous error code had string duplication in the form of:
logging.error('msg here')
raise Exception('msg here')
That approach also has the downside of having log duplication as
it had the local logging.err() and a global logging.exception()
inside send_internal_server_error capturing the exception message.
The actual code only requires raising an exception with a proper
error message.
Improve exception messages to give more error context.
Log every AssertionError as a backtrace.
Use the 'raise Exception from e' syntax to modify the a previously
raised exception 'e' into an exception with aditional context or
different type. This also prevents the message that warns about
newer exceptions being launch after an initial exception.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some users have mistakenly reported tiptorrent problems when the process
takes a long time. Specifically by rebooting or powering off the client
in the middle of the md5sum computation stage, just after the tiptorrent
transfer.
Same problem occurs when image creation command takes a long period of
time.
In order to help the user understand the different stages of commands
such as image creation or image restore using tiptorrent, the following
changes have been made to the current logging solution:
- Add log messages to warn users not to reboot or shut down the client
during a tiptorrent transfer, and also during the md5sum computation
stage.
- Add a log message telling the user that the image creation processes
have started.
- Use logging.exception inside "except:" blocks to print a traceback
with the log messsage.
(https://docs.python.org/3/library/logging.html#logging.exception)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix error paths in live operations which do not
reset the "browser" to the main page (one with the menu).
Add error logging messages when:
* _restartBrowser fails.
* ogChangeRepo fails.
Improve checksum fetch error handling. For example, when an invalid
repository IP is specified.
|
|
|
|
|
|
| |
Raise exception when tiptorrent-client subprocess runs normally but
exits with non-zero code. (For example, if download file allocation
failed)
|
|
|
|
|
|
|
|
| |
Integrates image restore command into native ogClient code. Further
reduces the need for external Bash scripts.
After a succesful image restore, OS configuration is still using
external Bash script "osConfigure/osConfigureCustom".
|
|
Utility and wrapper functions related to the usage of tiptorrent.
To be used by the image restore command.
|