To give you another update I’ve been reviewing the source code for the image replication and think I found that in the /packages/web/lib/service/fogservice.class.php file the replicateItems() function gathers its storagenode objects from the API route class. From here I think it checks the online flag from a json deserialized response from the API. This gave me the idea to see what the API says about the storage nodes.
I did an API call at the /storagenode route and found that this disconnected storage node is showing online. Another one is offline and correctly reporting its online status as “false” and this particular node doesn’t cause the replication service to crash.
Below is the API response for a node which is offline due to a down vpn tunnel but is showing it is online and as such causes the replication service to crash.
{
"count": 15,
"storagenodes": [
{
"id": "7",
"name": "Some-Offline-Node",
"description": "",
"isMaster": "1",
"storagegroupID": "7",
"isEnabled": "1",
"isGraphEnabled": "0",
"path": "/images",
"ftppath": "/images",
"bitrate": "",
"helloInterval": "",
"snapinpath": "/opt/fog/snapins",
"sslpath": "/opt/fog/snapins/ssl",
"ip": "192.168.113.197",
"maxClients": "10",
"user": "fogproject",
"pass": "somePassword",
"key": "",
"interface": "ens160",
"bandwidth": "0",
"webroot": "/fog",
"storagegroup": {
"id": "7",
"name": "SomeName",
"description": "",
"totalsupportedclients": 10,
"enablednodes": [
"7"
],
"allnodes": [
"7"
]
},
"clientload": 0,
"online": true **<---- this is saying its online but cannot be pinged through the down vpn**
}
Here is one of the nodes that is offline but the boolean “online” property is set to false. This node gives the message in the log that the node is offline and continues on with the program instead of attempting an ftp connection.
{
"id": "11",
"name": "aDifferentNode",
"description": "",
"isMaster": "1",
"storagegroupID": "11",
"isEnabled": "1",
"isGraphEnabled": "0",
"path": "/images",
"ftppath": "/images",
"bitrate": "",
"helloInterval": "",
"snapinpath": "/opt/fog/snapins",
"sslpath": "/opt/fog/snapins/ssl",
"ip": "192.168.1.134",
"maxClients": "10",
"user": "fogproject",
"pass": "somePassword",
"key": "",
"interface": "ens160",
"bandwidth": "0",
"webroot": "/fog",
"storagegroup": {
"id": "11",
"name": "someName",
"description": "",
"totalsupportedclients": 10,
"enablednodes": [
"11"
],
"allnodes": [
"11"
]
},
"clientload": 0,
"online": false **<--correctly set to false**
}
I will continue investigating the method that sets this online flag but thought this could be helpful to you. Have you ever seen anything like this before?