Giter Site home page Giter Site logo

cvmfs/client feature can set /software/components/profile/env to undefined in certain circumstances about template-library-standard HOT 9 CLOSED

quattor avatar quattor commented on July 26, 2024
cvmfs/client feature can set /software/components/profile/env to undefined in certain circumstances

from template-library-standard.

Comments (9)

jouvin avatar jouvin commented on July 26, 2024

Which variable? The line you mention is not an `if`` statement... Can you provide a extract of the faulty code?

from template-library-standard.

apdibbo avatar apdibbo commented on July 26, 2024

The code snippet is:

'/software/components/profile/env' = {
    if (is_defined(VO_ATLAS_LOCAL_AREA)) {
        SELF['ATLAS_LOCAL_AREA'] = VO_ATLAS_LOCAL_AREA;
    };

from template-library-standard.

jouvin avatar jouvin commented on July 26, 2024

Why do you say the error is trigged by this piece of code. The error is a validation error and this happens at a stage where it is not possible to say which line is responsible for the misconfiguration... From the error you mention, it's hard to say that this is connected to this. The error looks a bit surprising to me, in particular element at /{ components, { accounts suggesting that the components are not under /software/componentsbut under /components...

from template-library-standard.

apdibbo avatar apdibbo commented on July 26, 2024

Jrha advised me how to troubleshoot this by removing and replacing sections of the standard template to narrow down which section of code it was.

from template-library-standard.

jouvin avatar jouvin commented on July 26, 2024

Adding @jrha . I don't have enough context to help here but normally when you have a validation error, it gives the path that trigged the error and its value. Here is an example of validation error that I intentionally created (changing the 'perms' value to a number instead of a string):

     [panc] validation error [/scratch/jouvin/quattor/cdb/cfg/clusters/ipno/umd-3.0/profiles/ipngrid80.in2p3.fr.pan]
     [panc] validation requires type of 'string' but element is of type 'long'
     [panc] element path: '/software/components/filecopy/services/_2fetc_2fcvmfs_2fdefault_2elocal/perms'
     [panc] element value: 644
     [panc] type: 'string' [?:?]
     [panc] type: 'structure_filecopy' [/scratch/jouvin/quattor/cdb/cfg/quattor/14.10.0/components/filecopy/schema.pan:38.27-48.6]
     [panc] type: 'component_filecopy' [/scratch/jouvin/quattor/cdb/cfg/quattor/14.10.0/components/filecopy/schema.pan:51.27-55.1]
     [panc] path '/software/components/filecopy' bound to type component_filecopy in [/scratch/jouvin/quattor/cdb/cfg/quattor/14.10.0/components/filecopy/schema.pan:57.40-57.57]

In your case the error message looks a bit strange but the path suggests that the problem is with /, meaning the whole profile... I've the feeling that something weird happened in the way you are constructed the profile, leading to this. But I don't see what could be the link with the template you are mentionning.

from template-library-standard.

jrha avatar jrha commented on July 26, 2024

This is the code that is at fault:

    if (is_defined(VO_ATLAS_LOCAL_AREA)) {
        SELF['ATLAS_LOCAL_AREA'] = VO_ATLAS_LOCAL_AREA;
    }

It checks if VO_ATLAS_LOCAL_AREA is defined, but assumes that ATLAS_LOCAL_AREA is a key of SELF.

If ATLAS_LOCAL_AREA is undefined very-bad-things-happen™, which as far as I can tell works like this.

  1. SELF['ATLAS_LOCAL_AREA'] is not defined
  2. SELF['ATLAS_LOCAL_AREA'] is therefore equivalent to something like SELF[undef]
  3. '/software/components/profile/env' is set to VO_ATLAS_LOCAL_AREA
  4. Validation error is triggered.

from template-library-standard.

jrha avatar jrha commented on July 26, 2024

Scrap that, if '/software/components/profile/env' is undefined it triggers this error.
Apparently you cannot modify a non-existent nlist/dict.
Possibly the compiler could be more helpful.

from template-library-standard.

jrha avatar jrha commented on July 26, 2024

'/software/components/profile/env' ?= dict(); before this block fixes this problem.

from template-library-standard.

jrha avatar jrha commented on July 26, 2024

Reproduce with:

#'/software/components/profile/env/' ?= dict(); # Uncomment to fix horrible validation error.

'/software/components/profile/env/' = {
    if (is_defined(NONEXISTENT_VARIABLE)) {
        SELF['UNICORNS'] = NONEXISTENT_VARIABLE
    };
    SELF;
};

from template-library-standard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.