fix(wget_agent): add FOSSOLOGY_SKIP_CHOWN for NFSv4 compatibility #3145
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Upload fails on NFSv4 volumes where
chown()returnsOperation not permitteddue to NFSv4 identity mapping restrictions.Error:
This prevents FOSSology deployment in Docker Swarm environments using NFS storage.
Solution
Added optional
FOSSOLOGY_SKIP_CHOWNenvironment variable to allow uploads to continue whenchown()fails.Changes Made
src/wget_agent/agent/wget_agent.c
Modified 3 chown() call sites in DBLoadGold() function:
docker-compose.yml: Added environment variable to scheduler and web servicesBehavior
FOSSOLOGY_SKIP_CHOWN** (default): Original behavior, backward compatibleFOSSOLOGY_SKIP_CHOWN=true**:chown()failure logs WARNING, upload continues##Testing
1 . Restart containers
docker-compose down
docker-compose up -d
2 . Verify env variable
docker exec fossology_scheduler_1 env | grep FOSSOLOGY_SKIP_CHOWN
# FOSSOLOGY_SKIP_CHOWN=true
3. Create & upload test file
echo "NFSv4 Fix Test - $(date)" > ~/Desktop/test.txt
4.Check logs after upload
docker logs fossology_scheduler_1 2>&1 | grep -i chown | tail -20
5.Result - Upload succeeds
Fixes #3129