Skip to contentSkip to conversation

Strange issue with npm package fetch #poky #npmsw

DISCUSSION Arun Ravindran 3 participants 5 messages Apr 8, 2021 – Apr 22, 2021

lore
Share & tools
lore
#0 lore raw

Hi,

I have created some recipes for express and body-parser npm packages. I used devtool add <git URL> to create the bb file and npm-shrinkwrap.json.

The recipes works fine on one of our build machines, where as on another it fails!!

The error we get is

aravind2@tmsbuild008:/build/aravind2/work/custom-yocto/mvdevice/build$ bitbake core-image-minimal
ERROR: ExpansionError during parsing /build/aravind2/work/custom-yocto/sources/poky/../../meta-customapps/recipes-support/body-parser/body-parser_git.bb   | ETA:  0:00:25
Traceback (most recent call last):
File "/build/aravind2/work/custom-yocto/sources/poky/bitbake/lib/bb/utils.py", line 421, in better_eval(source=<code object <module> at 0x7f3a9d99fa50, file "Var <SRCPV>", line 1>, locals={'d': <bb.data_smart.DataSmart object at 0x7f3a9bb99c50>}, extraglobals={'d': <bb.data_smart.DataSmart object at 0x7f3a9bb99c50>}):
ctx[g] = extraglobals[g]
Quoted 1 line

    return eval(source, ctx, locals)

File "Var <SRCPV>", line 1, in <module>
File "/build/aravind2/work/custom-yocto/sources/poky/bitbake/lib/bb/fetch2/__init__.py", line 745, in get_srcrev(d=<bb.data_smart.DataSmart object at 0x7f3a9bb99c50>, method_name='sortable_revision'):
scms = []

Quoted 1 line

    fetcher = Fetch(d.getVar('SRC_URI').split(), d)

urldata = fetcher.ud
File "/build/aravind2/work/custom-yocto/sources/poky/bitbake/lib/bb/fetch2/__init__.py", line 1600, in Fetch.__init__(urls=['git://github.com/expressjs/body-parser.git;protocol=https', 'npmsw:///build/aravind2/work/custom-yocto/sources/poky/../../meta-customapps/recipes-support/body-parser/body-parser/npm-shrinkwrap.json'], d=<bb.data_smart.DataSmart object at 0x7f3a9bb99c50>, cache=True, localonly=False, connection_cache=None):
try:

Quoted 1 line

                    self.ud[url] = FetchData(url, d, localonly)

except NonLocalMethod:
File "/build/aravind2/work/custom-yocto/sources/poky/bitbake/lib/bb/fetch2/__init__.py", line 1262, in FetchData.__init__(url='npmsw:///build/aravind2/work/custom-yocto/sources/poky/../../meta-customapps/recipes-support/body-parser/body-parser/npm-shrinkwrap.json', d=<bb.data_smart.DataSmart object at 0x7f3a9bb99c50>, localonly=False):
if not self.method:

Quoted 1 line

            raise NoMethodError(url)

bb.data_smart.ExpansionError: Failure expanding variable SRCPV, expression was ${@bb.fetch2.get_srcrev(d)} which triggered exception NoMethodError: Could not find a fetcher which supports the URL: 'npmsw:///build/aravind2/work/custom-yocto/sources/poky/../../meta-customapps/recipes-support/body-parser/body-parser/npm-shrinkwrap.json'

Summary: There was 1 ERROR message shown, returning a non-zero exit code. aravind2@tmsbuild008:/build/aravind2/work/custom-yocto/mvdevice/build$

Both machines are  :    Ubuntu 18.04.5 LTS

what could be the issue here? How could this be fixed?

regards
Arun

#1 lore raw
Quoted 48 lines · Arun Ravindran

Hi,

I have created some recipes for express and body-parser npm packages. I used devtool add <git URL> to create the bb file and npm-shrinkwrap.json.

The recipes works fine on one of our build machines, where as on another it fails!!

The error we get is

aravind2@tmsbuild008:/build/aravind2/work/custom-yocto/mvdevice/build$ bitbake core-image-minimal
ERROR: ExpansionError during parsing /build/aravind2/work/custom-yocto/sources/poky/../../meta-
customapps/recipes-support/body-parser/body-parser_git.bb   | ETA:  0:00:25
Traceback (most recent call last):
  File "/build/aravind2/work/custom-yocto/sources/poky/bitbake/lib/bb/utils.py", line 421, in
better_eval(source=<code object <module> at 0x7f3a9d99fa50, file "Var <SRCPV>", line 1>, locals={'d':
<bb.data_smart.DataSmart object at 0x7f3a9bb99c50>}, extraglobals={'d': <bb.data_smart.DataSmart object at
0x7f3a9bb99c50>}):
                 ctx[g] = extraglobals[g]
    >    return eval(source, ctx, locals)

  File "Var <SRCPV>", line 1, in <module>
  File "/build/aravind2/work/custom-yocto/sources/poky/bitbake/lib/bb/fetch2/__init__.py", line 745, in get_srcrev(d=<bb.data_smart.DataSmart object at 0x7f3a9bb99c50>, method_name='sortable_revision'):
         scms = []
    >    fetcher = Fetch(d.getVar('SRC_URI').split(), d)
         urldata = fetcher.ud
  File "/build/aravind2/work/custom-yocto/sources/poky/bitbake/lib/bb/fetch2/__init__.py", line 1600, in Fetch.__init__(urls=['git://github.com/expressjs/body-parser.git;protocol=https', 'npmsw:///build/aravind2/work/custom-yocto/sources/poky/../../meta-customapps/recipes-support/body- parser/body-parser/npm-shrinkwrap.json'], d=<bb.data_smart.DataSmart object at 0x7f3a9bb99c50>, cache=True, localonly=False, connection_cache=None):
                     try:
    >                    self.ud[url] = FetchData(url, d, localonly)
                     except NonLocalMethod:
  File "/build/aravind2/work/custom-yocto/sources/poky/bitbake/lib/bb/fetch2/__init__.py", line 1262, in FetchData.__init__(url='npmsw:///build/aravind2/work/custom-yocto/sources/poky/../../meta- customapps/recipes-
support/body-parser/body-parser/npm-shrinkwrap.json', d=<bb.data_smart.DataSmart object at 0x7f3a9bb99c50>, localonly=False):
             if not self.method:
    >            raise NoMethodError(url)

bb.data_smart.ExpansionError: Failure expanding variable SRCPV, expression was ${@bb.fetch2.get_srcrev(d)} which triggered exception NoMethodError: Could not find a fetcher which supports the URL:
'npmsw:///build/aravind2/work/custom-yocto/sources/poky/../../meta-customapps/recipes-support/body- parser/body-parser/npm-shrinkwrap.json'

Quoted 6 lines

Summary: There was 1 ERROR message shown, returning a non-zero exit code. aravind2@tmsbuild008:/build/aravind2/work/custom-yocto/mvdevice/build$

Both machines are  :    Ubuntu 18.04.5 LTS

what could be the issue here? How could this be fixed?

Sounds like the wrong version of bitbake is being used, one which doesn't contain support for the npmsw fetcher.

Cheers,

Richard

#2 lore raw
Quoted 3 lines · Richard Purdie

Sounds like the wrong version of bitbake is being used, one which doesn't contain support for the npmsw fetcher.

the problematic machine has
BitBake Build Tool Core version 1.44.0

where as the other has
BitBake Build Tool Core version 1.46.0

regards
Arun

#3 lore raw

I created the bb files for these packages from the machine which has the older bitbake (because it needs to build from zeus branch of poky, where as the other builds from dunfell). The bb files compile now on the older bitbake, but not on the newer one....

aravind2@tmsbuild012:~/work/custom-yocto/mvdevice/build$ bitbake rpimvdevice-image
Loading cache: 100% |########################################################################################################################################| Time: 0:00:00
Loaded 3348 entries from dependency cache.
ERROR: ExpansionError during parsing /home/aravind2/work/custom-yocto/poky/../meta-customapps/recipes-support/express/express_git.bb                      | ETA:  --:--:--
Traceback (most recent call last):
File "Var <SRCPV>", line 1, in <module>
File "/home/aravind2/work/custom-yocto/poky/bitbake/lib/bb/fetch2/__init__.py", line 755, in get_srcrev(d=<bb.data_smart.DataSmart object at 0x7f7f3b4eca58>, method_name='sortable_revision'):
scms = []
Quoted 1 line

    fetcher = Fetch(d.getVar('SRC_URI').split(), d)

urldata = fetcher.ud
File "/home/aravind2/work/custom-yocto/poky/bitbake/lib/bb/fetch2/__init__.py", line 1638, in Fetch.__init__(urls=['git://github.com/expressjs/express.git;protocol=https', 'npm://registry.npmjs.org;name=accepts;version=1.3.7;subdir=node_modules/accepts', 'npm://registry.npmjs.org;name=array-flatten;version=1.1.1;subdir=node_modules/array-flatten', 'npm://registry.npmjs.org;name=body-parser;version=1.19.0;subdir=node_modules/body-parser', 'npm://registry.npmjs.org;name=content-disposition;version=0.5.3;subdir=node_modules/content-disposition', 'npm://registry.npmjs.org;name=content-type;version=1.0.4;subdir=node_modules/content-type', 'npm://registry.npmjs.org;name=cookie;version=0.4.0;subdir=node_modules/cookie', 'npm://registry.npmjs.org;name=cookie-signature;version=1.0.6;subdir=node_modules/cookie-signature', 'npm://registry.npmjs.org;name=debug;version=2.6.9;subdir=node_modules/debug', 'npm://registry.npmjs.org;name=depd;version=1.1.2;subdir=node_modules/depd', 'npm://registry.npmjs.org;name=encodeurl;version=1.0.2;subdir=node_modules/encodeurl', 'npm://registry.npmjs.org;name=escape-html;version=1.0.3;subdir=node_modules/escape-html', 'npm://registry.npmjs.org;name=etag;version=1.8.1;subdir=node_modules/etag', 'npm://registry.npmjs.org;name=finalhandler;version=1.1.2;subdir=node_modules/finalhandler', 'npm://registry.npmjs.org;name=fresh;version=0.5.2;subdir=node_modules/fresh', 'npm://registry.npmjs.org;name=merge-descriptors;version=1.0.1;subdir=node_modules/merge-descriptors', 'npm://registry.npmjs.org;name=methods;version=1.1.2;subdir=node_modules/methods', 'npm://registry.npmjs.org;name=on-finished;version=2.3.0;subdir=node_modules/on-finished', 'npm://registry.npmjs.org;name=parseurl;version=1.3.3;subdir=node_modules/parseurl', 'npm://registry.npmjs.org;name=path-to-regexp;version=0.1.7;subdir=node_modules/path-to-regexp', 'npm://registry.npmjs.org;name=proxy-addr;version=2.0.6;subdir=node_modules/proxy-addr', 'npm://registry.npmjs.org;name=qs;version=6.7.0;subdir=node_modules/qs', 'npm://registry.npmjs.org;name=range-parser;version=1.2.1;subdir=node_modules/range-parser', 'npm://registry.npmjs.org;name=safe-buffer;version=5.1.2;subdir=node_modules/safe-buffer', 'npm://registry.npmjs.org;name=send;version=0.17.1;subdir=node_modules/send', 'npm://registry.npmjs.org;name=serve-static;version=1.14.1;subdir=node_modules/serve-static', 'npm://registry.npmjs.org;name=setprototypeof;version=1.1.1;subdir=node_modules/setprototypeof', 'npm://registry.npmjs.org;name=statuses;version=1.5.0;subdir=node_modules/statuses', 'npm://registry.npmjs.org;name=type-is;version=1.6.18;subdir=node_modules/type-is', 'npm://registry.npmjs.org;name=utils-merge;version=1.0.1;subdir=node_modules/utils-merge', 'npm://registry.npmjs.org;name=vary;version=1.1.2;subdir=node_modules/vary'], d=<bb.data_smart.DataSmart object at 0x7f7f3b4eca58>, cache=True, localonly=False, connection_cache=None):
try:

Quoted 1 line

                    self.ud[url] = FetchData(url, d, localonly)

except NonLocalMethod:
File "/home/aravind2/work/custom-yocto/poky/bitbake/lib/bb/fetch2/__init__.py", line 1279, in FetchData.__init__(url='npm://registry.npmjs.org;name=accepts;version=1.3.7;subdir=node_modules/accepts', d=<bb.data_smart.DataSmart object at 0x7f7f3b4eca58>, localonly=False):
if hasattr(self.method, "urldata_init"):

Quoted 1 line

            self.method.urldata_init(self, d)

File "/home/aravind2/work/custom-yocto/poky/bitbake/lib/bb/fetch2/npm.py", line 132, in Npm.urldata_init(ud=<bb.fetch2.FetchData object at 0x7f7f3b4aa518>, d=<bb.data_smart.DataSmart object at 0x7f7f3b4eca58>):
if not ud.package:

Quoted 1 line

            raise MissingParameterError("Parameter 'package' required", ud.url)

bb.data_smart.ExpansionError: Failure expanding variable SRCPV, expression was ${@bb.fetch2.get_srcrev(d)} which triggered exception MissingParameterError: URL: 'npm://registry.npmjs.org;name=accepts;version=1.3.7;subdir=node_modules/accepts' is missing the required parameter 'Parameter 'package' required'

Summary: There was 1 ERROR message shown, returning a non-zero exit code. aravind2@tmsbuild012:~/work/custom-yocto/mvdevice/build$

We would need this in both zeus and dunfell, because we have two different targets boards to build where one BSP has no support for dunfell.

Is there a way to make these recipes work in both zeus and dunfell?

regards
Arun

#4 lore raw

Hello Arun,

I believe there are several patches from the master branch that you may need to allow these to work properly.

For Dunfell you may resend the patch(es) to the Bitbake mailing list with the Dunfell tag to see if it gets accepted and merged since Dunfell is still active, but Zeus is EOL so you'd have to cherry-pick these manually on your branch.

You can use the following wiki as reference to send the patch to oe-core or bitbake ML (use dunfell on subject-prefix).
https://www.openembedded.org/wiki/How_to_submit_a_patch_to_OpenEmbedded

Here's the Yocto Project releases webpage as reference as well:
https://wiki.yoctoproject.org/wiki/Releases
Cheers,

Alejandro

Quoted 40 lines · Arun Ravindran

I created the bb files for these packages from the machine which has the older bitbake (because it needs to build from zeus branch of poky, where as the other builds from dunfell). The bb files compile now on the older bitbake, but not on the newer one....

aravind2@tmsbuild012:~/work/custom-yocto/mvdevice/build$ bitbake rpimvdevice-image
Loading cache: 100% |########################################################################################################################################| Time: 0:00:00
Loaded 3348 entries from dependency cache.
ERROR: ExpansionError during parsing /home/aravind2/work/custom-yocto/poky/../meta-customapps/recipes-support/express/express_git.bb | ETA:  --:--:--
Traceback (most recent call last):
  File "Var <SRCPV>", line 1, in <module>
  File "/home/aravind2/work/custom-yocto/poky/bitbake/lib/bb/fetch2/__init__.py", line 755, in get_srcrev(d=<bb.data_smart.DataSmart object at 0x7f7f3b4eca58>, method_name='sortable_revision'):
         scms = []
    >    fetcher = Fetch(d.getVar('SRC_URI').split(), d)
         urldata = fetcher.ud
  File "/home/aravind2/work/custom-yocto/poky/bitbake/lib/bb/fetch2/__init__.py", line 1638, in Fetch.__init__(urls=['git://github.com/expressjs/express.git;protocol=https', 'npm://registry.npmjs.org;name=accepts;version=1.3.7;subdir=node_modules/accepts', 'npm://registry.npmjs.org;name=array-flatten;version=1.1.1;subdir=node_modules/array-flatten', 'npm://registry.npmjs.org;name=body-parser;version=1.19.0;subdir=node_modules/body-parser', 'npm://registry.npmjs.org;name=content-disposition;version=0.5.3;subdir=node_modules/content-disposition', 'npm://registry.npmjs.org;name=content-type;version=1.0.4;subdir=node_modules/content-type', 'npm://registry.npmjs.org;name=cookie;version=0.4.0;subdir=node_modules/cookie', 'npm://registry.npmjs.org;name=cookie-signature;version=1.0.6;subdir=node_modules/cookie-signature', 'npm://registry.npmjs.org;name=debug;version=2.6.9;subdir=node_modules/debug', 'npm://registry.npmjs.org;name=depd;version=1.1.2;subdir=node_modules/depd', 'npm://registry.npmjs.org;name=encodeurl;version=1.0.2;subdir=node_modules/encodeurl', 'npm://registry.npmjs.org;name=escape-html;version=1.0.3;subdir=node_modules/escape-html', 'npm://registry.npmjs.org;name=etag;version=1.8.1;subdir=node_modules/etag', 'npm://registry.npmjs.org;name=finalhandler;version=1.1.2;subdir=node_modules/finalhandler', 'npm://registry.npmjs.org;name=fresh;version=0.5.2;subdir=node_modules/fresh', 'npm://registry.npmjs.org;name=merge-descriptors;version=1.0.1;subdir=node_modules/merge-descriptors', 'npm://registry.npmjs.org;name=methods;version=1.1.2;subdir=node_modules/methods', 'npm://registry.npmjs.org;name=on-finished;version=2.3.0;subdir=node_modules/on-finished', 'npm://registry.npmjs.org;name=parseurl;version=1.3.3;subdir=node_modules/parseurl', 'npm://registry.npmjs.org;name=path-to-regexp;version=0.1.7;subdir=node_modules/path-to-regexp', 'npm://registry.npmjs.org;name=proxy-addr;version=2.0.6;subdir=node_modules/proxy-addr', 'npm://registry.npmjs.org;name=qs;version=6.7.0;subdir=node_modules/qs', 'npm://registry.npmjs.org;name=range-parser;version=1.2.1;subdir=node_modules/range-parser', 'npm://registry.npmjs.org;name=safe-buffer;version=5.1.2;subdir=node_modules/safe-buffer', 'npm://registry.npmjs.org;name=send;version=0.17.1;subdir=node_modules/send', 'npm://registry.npmjs.org;name=serve-static;version=1.14.1;subdir=node_modules/serve-static', 'npm://registry.npmjs.org;name=setprototypeof;version=1.1.1;subdir=node_modules/setprototypeof', 'npm://registry.npmjs.org;name=statuses;version=1.5.0;subdir=node_modules/statuses', 'npm://registry.npmjs.org;name=type-is;version=1.6.18;subdir=node_modules/type-is', 'npm://registry.npmjs.org;name=utils-merge;version=1.0.1;subdir=node_modules/utils-merge', 'npm://registry.npmjs.org;name=vary;version=1.1.2;subdir=node_modules/vary'], d=<bb.data_smart.DataSmart object at 0x7f7f3b4eca58>, cache=True, localonly=False, connection_cache=None):
                     try:
    >                    self.ud[url] = FetchData(url, d, localonly)
                     except NonLocalMethod:
  File "/home/aravind2/work/custom-yocto/poky/bitbake/lib/bb/fetch2/__init__.py", line 1279, in FetchData.__init__(url='npm://registry.npmjs.org;name=accepts;version=1.3.7;subdir=node_modules/accepts', d=<bb.data_smart.DataSmart object at 0x7f7f3b4eca58>, localonly=False):
             if hasattr(self.method, "urldata_init"):
    >            self.method.urldata_init(self, d)

  File "/home/aravind2/work/custom-yocto/poky/bitbake/lib/bb/fetch2/npm.py", line 132, in Npm.urldata_init(ud=<bb.fetch2.FetchData object at 0x7f7f3b4aa518>, d=<bb.data_smart.DataSmart object at 0x7f7f3b4eca58>):
             if not ud.package:
    >            raise MissingParameterError("Parameter 'package' required", ud.url)

bb.data_smart.ExpansionError: Failure expanding variable SRCPV, expression was ${@bb.fetch2.get_srcrev(d)} which triggered exception MissingParameterError: URL: 'npm://registry.npmjs.org;name=accepts;version=1.3.7;subdir=node_modules/accepts' is missing the required parameter 'Parameter 'package' required'

Summary: There was 1 ERROR message shown, returning a non-zero exit code.

aravind2@tmsbuild012:~/work/custom-yocto/mvdevice/build$ <mailto:aravind2@tmsbuild012:~/work/custom-yocto/mvdevice/build$>

We would need this in both zeus and dunfell, because we have two different targets boards to build where one BSP has no support for dunfell.

Is there a way to make these recipes work in both zeus and dunfell?

regards
Arun