Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Issue when creating ServiceNow Crossplane Provider code #258

Open
gaurav218 opened this issue Mar 9, 2022 · 7 comments
Open

Issue when creating ServiceNow Crossplane Provider code #258

gaurav218 opened this issue Mar 9, 2022 · 7 comments
Assignees
Labels
bug Something isn't working wontfix This will not be worked on

Comments

@gaurav218
Copy link

This is not a bug due to Terra Jet provider but I am facing an issue while creating ServiceNow provider code using Terra Jet provider template. When I run make generate it displays below error -

14:18:25 [ .. ] verify dependencies have expected content
all modules verified
14:18:25 [ OK ] go modules dependencies verified
14:18:25 [ .. ] generating provider schema for integrations/servicenow 0.9.5
make[1]: *** [Makefile:90: config/schema.json] Error 1
make: *** [build/makelib/common.mk:418: generate] Error 2

My guess is this could be due to the fact that Terraform ServiceNow provider is a custom provider and thats why terra jet is unable to create a proper schema.json. I am only trying to create code for "application" managed resource in ServiceNow.

Can anyone suggest where I am doing wrong here -

Pl. find my makefile export section snippet.
export TERRAFORM_VERSION := 1.1.6

export TERRAFORM_PROVIDER_SOURCE := integrations/servicenow
export TERRAFORM_PROVIDER_VERSION := 0.9.5
export TERRAFORM_PROVIDER_DOWNLOAD_NAME := terraform-provider-servicenow
export TERRAFORM_PROVIDER_DOWNLOAD_URL_PREFIX := https://github.com/tylerhatton/terraform-provider-servicenow/releases/v0.9.5

schema.json format -

{"format_version":"1.0","provider_schemas":{"registry.terraform.io/hashicorp/null":{"provider":{"version":0,"block":{"description_kind":"plain"}},"resource_schemas":{"null_resource":{"version":0,"block":{"attributes":{"id":{"type":"string","description":"This is set to a random value at create time.","description_kind":"markdown","computed":true},"triggers":{"type":["map","string"],"description":"A map of arbitrary strings that, when changed, will force the null resource to be replaced, re-running any associated provisioners.","description_kind":"markdown","optional":true}},"description":"The null_resource resource implements the standard resource lifecycle but takes no further action.\n\nThe triggers argument allows specifying an arbitrary set of values that, when changed, will cause the resource to be replaced.","description_kind":"markdown"}}},"data_source_schemas":{"null_data_source":{"version":0,"block":{"attributes":{"has_computed_default":{"type":"string","description":"If set, its literal value will be stored and returned. If not, its value defaults to \"default\". This argument exists primarily for testing and has little practical use.","description_kind":"markdown","optional":true,"computed":true},"id":{"type":"string","description":"This attribute is only present for some legacy compatibility issues and should not be used. It will be removed in a future version.","description_kind":"markdown","deprecated":true,"computed":true},"inputs":{"type":["map","string"],"description":"A map of arbitrary strings that is copied into the outputs attribute, and accessible directly for interpolation.","description_kind":"markdown","optional":true},"outputs":{"type":["map","string"],"description":"After the data source is "read", a copy of the inputs map.","description_kind":"markdown","computed":true},"random":{"type":"string","description":"A random value. This is primarily for testing and has little practical use; prefer the hashicorp/random provider for more practical random number use-cases.","description_kind":"markdown","computed":true}},"description":"The null_data_source data source implements the standard data source lifecycle but does not\ninteract with any external APIs.\n\nHistorically, the null_data_source was typically used to construct intermediate values to re-use elsewhere in configuration. The\nsame can now be achieved using locals.\n","description_kind":"markdown","deprecated":true}}}}}}

@gaurav218 gaurav218 added the bug Something isn't working label Mar 9, 2022
@turkenh
Copy link
Member

turkenh commented Mar 11, 2022

@gaurav218 could you check if you have any details in the following file .work/terraform/terraform-logs.txt?

https://github.com/crossplane-contrib/provider-jet-template/blob/main/Makefile#L91

@turkenh turkenh self-assigned this Mar 11, 2022
@gaurav218
Copy link
Author

Thnx for the response, the issue was with wrong source value.

I did ran "make generate" and now getting below logs in /terraform-logs.txt file-

Initializing the backend...

Initializing provider plugins...

  • Finding tylerhatton/servicenow versions matching "0.9.5"...
  • Installing tylerhatton/servicenow v0.9.5...
  • Installed tylerhatton/servicenow v0.9.5 (self-signed, key ID 4B1A29E261D0350A)

Partner and community providers are signed by their developers.
If you'd like to know more about provider signing, you can read about it here:
https://www.terraform.io/docs/cli/plugins/signing.html

Terraform has created a lock file .terraform.lock.hcl to record the provider
selections it made above. Include this file in your version control repository
so that Terraform can guarantee to make the same selections by default when
you run "terraform init" in the future.

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.

But I received following error in cmd -

build command-line-arguments: cannot load embed: malformed module path "embed": missing dot in first path element
apis/generate.go:33: running "go": exit status 1
generate: open /home/azureuser/provider-jet-template/apis/v1alpha1/zz_generated.deepcopy.go: no such file or directory
11:10:37 [FAIL]
make[1]: *** [build/makelib/golang.mk:271: go.generate] Error 1
make: *** [build/makelib/common.mk:419: generate] Error 2
root@ubuntuvm2:/home/azureuser/provider-jet-template# ls

@gaurav218
Copy link
Author

gaurav218 commented Mar 11, 2022

assume this error is due to old go version and need to upgrade to 1.16 or above

@gaurav218
Copy link
Author

gaurav218 commented Mar 11, 2022

@turkenh, thnx for your support. I am getting an error related to github repo not exist. When I checked in https://github.com/orgs/crossplane-contrib/repositories?q=&type=all&language=&sort=
for servicenow repo obviously it will not be there since this is the first time I am trying to create one.
For dummy purpose I have created an empty one now.
This provider code is related to servicenow so do I need to pass github username and ped in providerconfig.yaml file??
Error details -

go: finding module for package github.com/crossplane/crossplane-runtime/pkg/feature
go: finding module for package servicenow.com/crossplane-contrib/provider-jet-servicenow/config/application
go: finding module for package servicenow.com/crossplane/terrajet/pkg/config
go: finding module for package servicenow.com/crossplane/terrajet/pkg/types/conversion/cli
go: finding module for package servicenow.com/hashicorp/terraform-plugin-sdk/v2/helper/schema
go: finding module for package github.com/crossplane-contrib/provider-jet-servicenow/apis/v1alpha1
go: finding module for package github.com/crossplane/crossplane-runtime/pkg/errors
goelster/cmd/generator imports
github.com/crossplane-contrib/provider-jet-servicenow/config: cannot find module providing package github.com/crossplane-contrib/provider-jet-servicenow/config: module github.com/crossplane-contrib/provider-jet-servicenow/config: git ls-remote -q origin in /root/provider-jet-template/.work/pkg/pkg/mod/cache/vcs/ef8347fbf4993fb672e93ae0ddf79bf4147515fbda8c80d74edb1e717bb82124: exit status 128:
Host key verification failed.
fatal: Could not read from remote repository.

    Please make sure you have the correct access rights
    and the repository exists.

goelster/cmd/provider imports
github.com/crossplane-contrib/provider-jet-servicenow/apis: cannot find module providing package github.com/crossplane-contrib/provider-jet-servicenow/apis: module github.com/crossplane-contrib/provider-jet-servicenow/apis: git ls-remote -q origin in /root/provider-jet-template/.work/pkg/pkg/mod/cache/vcs/ef8347fbf4993fb672e93ae0ddf79bf4147515fbda8c80d74edb1e717bb82124: exit status 128:
Host key verification failed.
fatal: Could not read from remote repository.

    Please make sure you have the correct access rights
    and the repository exists.

goelster/cmd/provider imports
github.com/crossplane-contrib/provider-jet-servicenow/internal/clients: cannot find module providing package github.com/crossplane-contrib/provider-jet-servicenow/internal/clients: module github.com/crossplane-contrib/provider-jet-servicenow/internal/clients: git ls-remote -q origin in /root/provider-jet-template/.work/pkg/pkg/mod/cache/vcs/ef8347fbf4993fb672e93ae0ddf79bf4147515fbda8c80d74edb1e717bb82124: exit status 128:
Host key verification failed.
fatal: Could not read from remote repository.

    Please make sure you have the correct access rights
    and the repository exists.

goelster/cmd/provider imports
github.com/crossplane-contrib/provider-jet-servicenow/internal/controller: cannot find module providing package github.com/crossplane-contrib/provider-jet-servicenow/internal/controller: module github.com/crossplane-contrib/provider-jet-servicenow/internal/controller: git ls-remote -q origin in /root/provider-jet-template/.work/pkg/pkg/mod/cache/vcs/ef8347fbf4993fb672e93ae0ddf79bf4147515fbda8c80d74edb1e717bb82124: exit status 128:
Host key verification failed.
fatal: Could not read from remote repository.

    Please make sure you have the correct access rights
    and the repository exists.

goelster/cmd/provider imports
github.com/crossplane/crossplane-runtime/pkg/feature: module github.com/crossplane/crossplane-runtime@latest found (v0.15.1), but does not contain package github.com/crossplane/crossplane-runtime/pkg/feature
goelster/config imports
servicenow.com/crossplane-contrib/provider-jet-servicenow/config/application: cannot find module providing package servicenow.com/crossplane-contrib/provider-jet-servicenow/config/application: unrecognized import path "servicenow.com/crossplane-contrib/provider-jet-servicenow/config/application": parsing servicenow.com/crossplane-contrib/provider-jet-servicenow/config/application: XML syntax error on line 8: expected attribute name in element
goelster/config imports
servicenow.com/crossplane/terrajet/pkg/config: cannot find module providing package servicenow.com/crossplane/terrajet/pkg/config: unrecognized import path "servicenow.com/crossplane/terrajet/pkg/config": reading https://servicenow.com/crossplane/terrajet/pkg/config?go-get=1: 404 Not Found
goelster/config imports
servicenow.com/crossplane/terrajet/pkg/types/conversion/cli: cannot find module providing package servicenow.com/crossplane/terrajet/pkg/types/conversion/cli: unrecognized import path "servicenow.com/crossplane/terrajet/pkg/types/conversion/cli": reading https://servicenow.com/crossplane/terrajet/pkg/types/conversion/cli?go-get=1: 404 Not Found
goelster/config imports
servicenow.com/hashicorp/terraform-plugin-sdk/v2/helper/schema: cannot find module providing package servicenow.com/hashicorp/terraform-plugin-sdk/v2/helper/schema: unrecognized import path "servicenow.com/hashicorp/terraform-plugin-sdk/v2/helper/schema": reading https://servicenow.com/hashicorp/terraform-plugin-sdk/v2/helper/schema?go-get=1: 404 Not Found
goelster/internal/clients imports
github.com/crossplane-contrib/provider-jet-servicenow/apis/v1alpha1: cannot find module providing package github.com/crossplane-contrib/provider-jet-servicenow/apis/v1alpha1: module github.com/crossplane-contrib/provider-jet-servicenow/apis/v1alpha1: git ls-remote -q origin in /root/provider-jet-template/.work/pkg/pkg/mod/cache/vcs/ef8347fbf4993fb672e93ae0ddf79bf4147515fbda8c80d74edb1e717bb82124: exit status 128:
Host key verification failed.
fatal: Could not read from remote repository.

    Please make sure you have the correct access rights
    and the repository exists.

goelster/cmd/generator imports
github.com/crossplane/terrajet/pkg/pipeline imports
github.com/crossplane/crossplane-runtime/pkg/errors: module github.com/crossplane/crossplane-runtime@latest found (v0.15.1), but does not contain package github.com/crossplane/crossplane-runtime/pkg/errors
16:03:14 [FAIL]
make[1]: *** [build/makelib/golang.mk:274: go.generate] Error 1
make: *** [build/makelib/common.mk:419: generate] Error 2


@gaurav218
Copy link
Author

@turkenh any pointers here on above issue. The target state is to manage this multicloud environment using Crossplane. We need custom servicenow provider to create managed resources for apps teams. Can you suggest what are the exact steps to achieve it.

@turkenh
Copy link
Member

turkenh commented Mar 21, 2022

@gaurav218 it is a bit hard to follow here, any chance that you can share your latest state with a repo/PR so that I can check/reproduce the issue on my side?

@stale
Copy link

stale bot commented Aug 13, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Aug 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants