This API Developer Portal can run low on disk space and/or inodes under certain situations. This can result in a user who may be unable to edit files, enable APIs, etc . This article provides an immediate solution and includes a method of prevention
Log entries, such as the following, may be viewed in the /opt/Deployments/lrs/server/logs/catalina.out log file:
<Exception class="com.thelevel.repository.RepositoryException">
<WhatHappened>Unable to lock document.</WhatHappened>
<Exception class="com.thelevel.repository.RepositoryException">
<WhatHappened>
Failed to store document @ repository/META/HEAD/sitebuilder/pages/documentation/page.xml
</WhatHappened>
<Exception class="com.thelevel.repository.RepositoryException">
<WhatHappened>
java.io.FileNotFoundException: /opt/Deployments/lrs/repository/META/HEAD/sitebuilder/pages/documentation/page.xml__tmp (No space left on device)
</WhatHappened>
<AdditionalInfo>
java.io.FileOutputStream.open(Native Method) java.io.FileOutputStream.<init>(FileOutputStream.java:194) java.io.FileOutputStream.<init>(FileOutputStream.java:145) com.thelevel.repository.store.FileSystemStore.writeFileToDisk(FileSystemStore.java:244) com.thelevel.repository.store.FileSystemStore.storeDocument(FileSystemStore.java:121) com.thelevel.repository.store.FileSystemXMLStore.addDocument(FileSystemXMLStore.java:186) com.thelevel.repository.store.FileSystemXMLStore.addDocument(FileSystemXMLStore.java:193) com.thelevel.repository.filesystem.FileSystemRepository.riUpdateMetaInfo(FileSystemRepository.java:495)
It is safe to remove the contents of the /opt/Deployments/lrs/repository/VERSIONS/xml_content/layer7/APIs/api-availability.xml directory on the filesystem, but directory itself must be retained.
To immediately free up disk space and inodes on the API Developer Portal, the following steps should be performed:
1. Log on to the API Developer Portal node as the root user.
2. Run this command: # find /opt/Deployments/lrs/repository/VERSIONS/xml_content/layer7/APIs/api-availability.xml/ -type f -mtime +2 -delete
3. Verify the available disk space and inodes using the commands listed below.
A. Disk space: # df -h
B. Inodes: # df -i
Prevention
To prevent this issue from occurring, it is necessary to implement a cron job which will remove unnecessary files on a scheduled basis.
1. Log on to the API Developer Portal node as the root user.
2. Run this command: # crontab -e
3. Type "i" to begin insert mode, then create a new line which reads as follows: 2 2 * * * find /opt/Deployments/lrs/repository/VERSIONS/xml_content/layer7/APIs/api-availability.xml/ -type f -mtime +2 -delete
4. Save the crontab by using the [Esc] key, and then entering: :wq!
Verify by running this command: # crontab -l