Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Service fails to find go.mod for certgen #50

Open
kastl-ars opened this issue Jul 16, 2024 · 2 comments
Open

Service fails to find go.mod for certgen #50

kastl-ars opened this issue Jul 16, 2024 · 2 comments

Comments

@kastl-ars
Copy link

Another instance of the service not finding the go.mod file:

https://github.com/minio/certgen/tree/v1.3.0

Running source_service 'go_modules' ...
INFO:obs-service-go_modules:Running OBS Source Service: obs-service-go_modules
INFO:obs-service-go_modules:Autodetecting archive since no archive param provided in _service
DEBUG:obs-service-go_modules:Trying to find archive name with pattern certgen*.tar.gz
DEBUG:obs-service-go_modules:Trying to find archive name with pattern certgen*.tar.xz
DEBUG:obs-service-go_modules:Trying to find archive name with pattern certgen*.tar.zst
DEBUG:obs-service-go_modules:Trying to find archive name with pattern certgen*.tar.lz
DEBUG:obs-service-go_modules:Trying to find archive name with pattern certgen*.tar.bz2
DEBUG:obs-service-go_modules:Trying to find archive name with pattern certgen*.obscpio
INFO:obs-service-go_modules:Archive autodetected at /XXX/certgen/certgen-1.3.0.obscpio
INFO:obs-service-go_modules:Using archive certgen-1.3.0.obscpio
INFO:obs-service-go_modules:Extracting certgen-1.3.0.obscpio to /tmp/tmpvu5q022p
INFO:obs-service-go_modules:Switching to /tmp/tmpvu5q022p
ERROR:obs-service-go_modules:File go.mod not found under /tmp/tmpvu5q022p/certgen
Aborting: service call failed:  /usr/lib/obs/service/go_modules --basename certgen --subdir ./ --outdir /XXX/certgen/tmphyblrqfd.go_modules.service

The basename was incorrectly detected as certgen/.github, but even with setting the basename and the subdir it still fails.

  <service name="go_modules" mode="manual">
    <param name="basename">certgen</param>
    <param name="subdir">./</param>
  </service>
@johanneskastl
Copy link

Hmmm, seems like the basename_from_archive function looks for only directories within the tarball. And it only finds one: .github.

If I change the order, in which the functions are being called, then the basename detection seems to work:

            args.basename                                                                                                                   
            or basename_from_archive_name(archive)                                                                                          
            or basename_from_archive(archive)                                                                                               
        )

@johanneskastl
Copy link

johanneskastl commented Jul 16, 2024

The changes from #51 seem to do the trick in this case, at least it then leads to #52... :-)

(Manually setting the basename also works, but the service should be smart enough IMHO)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants