broadcast: repeat broadcast fails storage.objects.create

Issue #288 open
Trek Hopton created an issue

Repeat broadcast cron fails because it doesn’t have the permissions it needs. Namely storage.objects.create.

2023/08/24 01:37:02 cron: error calling "repeatBroadcast" at site=806740323415 with "{\"SKey\":806740323415,\"Name\":\"Stony Point CuttleCam by AusOcean\",\"ID\":\"C8HFHUuablc\",\"SID\":\"\",\"CID\":\"\",\"StreamName\":\"Stony Point Stream\",\"Description\":\"<REDACTED>",\"Privacy\":\"Public\",\"Resolution\":\"1080p\",\"StartTime\":\"2023-06-29T16:15\",\"StartTimeUnix\":\"1687991400\",\"Start\":\"2023-06-28T22:30:00Z\",\"EndTime\":\"2023-06-29T17:00\",\"EndTimeUnix\":\"1688023800\",\"End\":\"2023-06-29T07:30:00Z\",\"VidforwardHost\":\"\",\"DeviceName\":\"\",\"OnActions\":\"PI_020623.mode=Normal,ESP_94A39A.Power=true\",\"OffActions\":\"ESP_94A39A.Power=false\",\"RTMPVar\":\"PI_020623.RTMPURL\",\"ScheduleTime\":\"7:50\",\"Active\":false,\"Slate\":false,\"LastStatusCheck\":\"0001-01-01T00:00:00Z\",\"LastChatMsg\":\"0001-01-01T00:00:00Z\",\"LastHealthCheck\":\"0001-01-01T00:00:00Z\",\"Issues\":0,\"SendMsg\":false,\"SensorList\":[{\"SendMsg\":false,\"Sensor\":{\"SKey\":806740323415,\"SID\":\"AnalogValue\",\"Pin\":\"ESP_0D2AA6.X10\",\"Quantity\":\"OTH\",\"Func\":\"none\",\"Args\":\"\",\"Scale\":1,\"Offset\":0,\"Units\":\"\",\"Format\":\"round2\"},\"Name\":\"analogvalue\",\"DeviceMac\":154664809867942},{\"SendMsg\":false,\"Sensor\":{\"SKey\":806740323415,\"SID\":\"BatteryVoltageLand\",\"Pin\":\"ESP_0D2AA6.A0\",\"Quantity\":\"DCV\",\"Func\":\"scale\",\"Args\":\"0.02845\",\"Scale\":1,\"Offset\":0,\"Units\":\"V\",\"Format\":\"round2\"},\"Name\":\"batteryvoltageland\",\"DeviceMac\":154664809867942},{\"SendMsg\":false,\"Sensor\":{\"SKey\":806740323415,\"SID\":\"AirTemperatureA39A\",\"Pin\":\"ESP_94A39A.X50\",\"Quantity\":\"MWH\",\"Func\":\"linear\",\"Args\":\"0.1, -273.15\",\"Scale\":0,\"Offset\":0,\"Units\":\"C\",\"Format\":\"round1\"},\"Name\":\"airtemperaturea39a\",\"DeviceMac\":256029519815578},{\"SendMsg\":false,\"Sensor\":{\"SKey\":806740323415,\"SID\":\"AnalogValueA39A\",\"Pin\":\"ESP_94A39A.X10\",\"Quantity\":\"OTH\",\"Func\":\"none\",\"Args\":\"\",\"Scale\":0,\"Offset\":0,\"Units\":\"\",\"Format\":\"round2\"},\"Name\":\"analogvaluea39a\",\"DeviceMac\":256029519815578},{\"SendMsg\":false,\"Sensor\":{\"SKey\":806740323415,\"SID\":\"BatteryVoltageA39A\",\"Pin\":\"ESP_94A39A.A0\",\"Quantity\":\"DCV\",\"Func\":\"scale\",\"Args\":\"0.0296\",\"Scale\":0,\"Offset\":0,\"Units\":\"V\",\"Format\":\"round2\"},\"Name\":\"batteryvoltagea39a\",\"DeviceMac\":256029519815578},{\"SendMsg\":false,\"Sensor\":{\"SKey\":806740323415,\"SID\":\"BootReasonA39A\",\"Pin\":\"ESP_94A39A.X13\",\"Quantity\":\"OTH\",\"Func\":\"none\",\"Args\":\"\",\"Scale\":1,\"Offset\":0,\"Units\":\"\",\"Format\":\"round\"},\"Name\":\"bootreasona39a\",\"DeviceMac\":256029519815578},{\"SendMsg\":false,\"Sensor\":{\"SKey\":806740323415,\"SID\":\"HumidityA39A\",\"Pin\":\"ESP_94A39A.X51\",\"Quantity\":\"MMB\",\"Func\":\"scale\",\"Args\":\".1\",\"Scale\":0,\"Offset\":0,\"Units\":\"%\",\"Format\":\"round2\"},\"Name\":\"humiditya39a\",\"DeviceMac\":256029519815578},{\"SendMsg\":true,\"Sensor\":{\"SKey\":806740323415,\"SID\":\"WaterTemperatureA39A\",\"Pin\":\"ESP_94A39A.X60\",\"Quantity\":\"MTW\",\"Func\":\"linear\",\"Args\":\"0.1, -273.15\",\"Scale\":0,\"Offset\":0,\"Units\":\"C\",\"Format\":\"round2\"},\"Name\":\"watertemperaturea39a\",\"DeviceMac\":256029519815578}],\"RTMPKey\":\"y9g2-x4k8-51zk-81wb-0zxh\",\"UsingVidforward\":false,\"CamOn\":\"\",\"CamOff\":\"\",\"CheckingHealth\":true,\"AttemptingToStart\":false,\"ListingSecondaries\":false}": could not set up broadcast: could not broadcast stream: could not get service: could not save new token: could not close written object: googleapi: Error 403: oceancron@appspot.gserviceaccount.com does not have storage.objects.create access to the Google Cloud Storage object. Permission 'storage.objects.create' denied on resource (or it may not exist)., forbidden resp: {0 map[]}

This seems to be because we are trying to write a token to the bucket object youtube-api-credentials.json. This is happening in broadcast/youtube.go line 100.

Comments (2)

  1. Alan Noble
    • changed status to open

    Why are we writing to the bucket object that contains credentials. If we need to write, we should write to a different object.

  2. Log in to comment