question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Getting Cannot access package artifact

See original GitHub issue

My project is using serverless-package-python-functions for packaging Python functions. I’m getting this error when trying to package my functions with warmup plugin

Error:
Cannot access package artifact at "_build/{serviceName}-{stage}-warmup-plugin-default.zip" (for "warmUpPluginDefault"): ENOENT: no such file or directory, access '{serviceName}-{stage}-warmup-plugin-default.zip'

Here is my warmup config in the custom stage

warmup:
    default:
      enabled: false
      cleanFolder: false
      package:
        individually: True
        artifact: ${self:custom.pkgPyFuncs.buildDir}/{serviceName}-${opt:stage}-warmup-plugin-default.zip

And the config at the function I want to warmup

  warmup:
    default:
      enabled: true

From my knowledge it’s looking for the zip file containing the content of .warmup folder. So I tried to add the artifact part in my warmup config, but the error still hasn’t been resolved. Would love someone could help me on this

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
juanjoDiazcommented, Apr 25, 2022

Hi @qngdt,

The problem is here: https://github.com/ubaniabalogun/serverless-package-python-functions/blob/c8ce439fa46534716d0ebb9fa7e63298960474b0/index.js#L40-L46

The warmup plugin does a process to reset missconfigurations applied by plugins like serverless-package-python-functions, webpack, bundle, etc.

Unfortunately, because the serverless-package-python-functions plugin doesn’t override the config but modifies. The fix doesn’t work here.

The plugin should not modify functions that are not even Python to start with. Adding a check for that would be trivial.

Another solution could be for the author of the plugin to update his code so it overrides the setting, doesn’t update the actual object:

  autoconfigArtifacts() {
    _.map(this.serverless.service.functions, (func_config, func_name) => {
      let autoArtifact = `${this.buildDir}/${func_config.name}.zip`
      func_config = {
        ...func_config,
        package: {
          ...func_config.package,
          artifact = func_config.package.artifact || autoArtifact,
        }
      }
    })
  }

So, unfortunately, you need to create an issue or a PR on that plugin. And it doesn’t seem very well maintained 🙁

0reactions
qngdtcommented, Apr 24, 2022

Hi @qngdt,

Your repo is missing the package.json, so there is no way for me to know which version of serverless or the plugins you are using.

Are you using the latest warmup plugin? You might be seeing an issue that was introduced in v6.1.0 and fixed in v7.0.1

Hi @juanjoDiaz,

I have updated the repo with the package.json files. Sorry I did not realize that the example repo from serverless doesn’t contain those. The error is still persist though.

Thanks for still keep an eye on this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

`serverless package` doesn't honor the artifact and ... - GitHub
I'm trying to use the artifact and package . individually: true to have separate packages for each of my function and use the...
Read more >
Artifacts not working as expected - Serverless Framework
In my build step, I run serverless package to a folder and then delete the CF templates and state file, leaving only the...
Read more >
Maven cannot find package of installed artifact - Stack Overflow
I'm trying to run mvn clean install on a project and get a message after failure that says (names changed): C:\<...>\SomeClass.java:[23,29] ...
Read more >
Azure Artifacts fails to get a package while using an upstream ...
I'm trying to use Maven Central as an upstream source for Maven, but it's failing with org.sonatype.sisu.inject:guice-parent:pom:2.9.1:.
Read more >
Set up permissions - Azure Artifacts - Microsoft Learn
Configure Artifacts permissions for feeds, views, and pipelines. ... To access Azure Artifacts settings, select the Azure Artifacts settings ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found