Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions web/skins/classic/views/js/event.js
Original file line number Diff line number Diff line change
Expand Up @@ -1359,6 +1359,10 @@ function onStatsResize(vidWidth) {
}

function initPage() {
if (eventNotFound) {
console.log("Event was not found.");
return;
}
getAvailableTags();
getSelectedTags();

Expand Down
1 change: 1 addition & 0 deletions web/skins/classic/views/js/event.js.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
// PHP variables to JS
//
var connKey = '<?php echo $connkey ?>';
const eventNotFound = <?php echo ((!$Event->Id() || ($Event->Id() and !file_exists($Event->Path()))) ? "true" : "false") ?>;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only problem here is that the event might exist on a different server. I would want to look for the file on the server that owns the storage area that the event is stored on. So..
If Event->Storage>ServerId() != currentServerId then ajax->checkforExistence().

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

checkforExistence().

But how can we check a file on another server?

  • We don't have access to the other server's file system, right?
  • We haven't authenticated on the other server, and we can't pass the authorization token and name in the query string?

The multi-server configuration is still a mystery to me...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@connortechnology
Moreover, I don't understand how a reference to a recorded event on another BB server could have ended up in the AA server database. I don't think that's possible...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They share the same db

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They share the same db

Oh, even so... I see, interesting, I didn't know that...
But I still have a question: what query can I use to check for a recorded event on another server? Isaac, have you done this before? If so, how?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And again, I don't understand anything...
We have one storage for all servers, which means $Event->Path() will return the correct address.
For example:
there is Storage_A and Storage_B
there is Server_A and Server_B
Storage_A is connected to Server_A at /mnt/A/S_A
Storage_A is connected to Server_B at /mnt/B/S_A
Storage_B is connected to Server_B at /mnt/B/S_B

  • When requesting an event stored on Storage_A from Server_A, $Event->Path() should return /mnt/A/S_A
  • When requesting an event stored on Storage_A from Server_B, $Event->Path() should return /mnt/B/S_A
  • When requesting an event stored on Storage_B from Server_A, $Event->Path() should return nothing, because Storage_B isn't connected to Server_A. And we have no way to verify the presence of the recorded event.
    Isn't that right?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have to use the API on the assigned server. Ideally all servers would have access to all storage, but sometimes that isn't true. Some people want to use a server just for the UI, multiple recording servers, etc. Sometimes located very differently on the network with slow unreliable network. So each recording server has it's own local storage which is reliable for recording, but may not be reliable (or performant) for playback. Which is why we can assign a ServerId to Storage to tell us where the best place to access it is. You have to ask the API on the server assigned to the Storage.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the clarification.


var eventData = {
<?php if ( $Event->Id() ) { ?>
Expand Down
2 changes: 1 addition & 1 deletion web/views/view_video.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
}

if ( ! ($fh = @fopen($path, 'rb') ) ) {
ZM\Error('Can\'t open video at '.$path);
ZM\Debug('Can\'t open video at '.$path);
header('HTTP/1.0 404 Not Found');
die();
}
Expand Down
Loading