During the scale-up of our new firmware tests that includes the new PublishQueueExt library, we've seen these errors being thrown:
0000240159 [wiring] ERROR: open() failed: 2
0000240159 [app.pubq] ERROR: error saving event to fileNum 5
0000240169 [wiring] ERROR: open() failed: 2
0000240169 [app.pubq] ERROR: error saving event to fileNum 6
0000240183 [wiring] ERROR: open() failed: 2
0000240183 [app.pubq] ERROR: error saving event to fileNum 7
Which is thrown from the
event.saveData(queueFilePath.c_str()) == SYSTEM_ERROR_NONE; call
Which in turn fails here:
int CloudEvent::saveData(const char* path) {
if (!isReadable()) {
return error();
}
int fd = open(path, O_CREAT | O_TRUNC | O_WRONLY, S_IRWXU);
if (fd < 0) {
LOG(ERROR, "open() failed: %d", errno);
return Error::FILE;
}
A small note is that I use a custom dir for the events, but it works on other devices for some reason:
// Initialize POSIX-based queue system
PublishQueueExt::instance().setup();
PublishQueueExt::instance().withDirPath(DeviceConfigurationConstants::PUBLISH_QUEUE_DIRECTORY);