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

[error] file '~/.awless/aws/rdf/client-name/global/access.nt': bufio.Scanner: token too long #300

Open
krestivo-kdinfotech opened this issue Nov 29, 2021 · 3 comments

Comments

@krestivo-kdinfotech
Copy link

krestivo-kdinfotech commented Nov 29, 2021

Happens consistently, deleting the file does not make the problem go away.

Does not happen on list operations, only on show operations

wc says:

  3541  14307 454141 access.nt
@krestivo-kdinfotech
Copy link
Author

The frequency of occurrence of the longest lines is:

([65984 1]
 [8847 1]
 [7199 1]
 [6412 1]
 [5310 1]
 [4310 1]
 [3796 1]
 [2722 1]
 [2719 1]
 [2718 1]
 [2609 1]
 [2487 1]
 [2465 1]
 [2437 1]
 [2142 1]
 [2070 1]
 [2052 1]
 [2032 1]
 [1979 1]
 [1977 1]
 [1934 1]
 [1911 1]
 [1891 1]
 [1822 1]
 [1809 1]
 [1786 1]
 [1675 1]

And that 65984 line tells me somewhere you have a hardcoded 65535 16-bit int limit.

@krestivo-kdinfotech
Copy link
Author

krestivo-kdinfotech commented Nov 29, 2021

The offending line appears to begin with:

"<ANPAJ7W6266ELXF5MISDS> <cloud:document> \"{\"Statement\":[{\"Action\":[\"apigateway:GET\"],\"Effect\":\"Allow\",\"Resource\":[\"arn:aws:apigateway:*::/account\",\"arn:aws:apigateway:*::/apis\",\"arn:aws:apigateway:*::/apis/*\",\"arn:aws:apigateway:*::/apis/*/authorizers\",\"arn:aws:apigateway:*::/apis/*/authorizers/*\",\"arn:aws:apigateway:*::/apis/*/deployments\",\"arn:aws:apigateway:*::/apis/*/deployments/*\",\"arn:aws:apigateway:*::/apis/*/integrations\",\"arn:aws:apigateway:*::/apis/*/integrations/*\",\"arn:aws:apigateway:*::/apis/*/integrations/*/integrationresponses\",\"arn:aws:apigateway:*::/apis/*/integrations/*/integrationresponses/*\",\"arn:aws:apigateway:*::/apis/*/models\",\"arn:aws:apigateway:*::/apis/*/models/*\",\"arn:aws:apigateway:*::/apis/*/routes\",\"arn:aws:apigateway:*::/apis/*/routes/*\",\"arn:aws:apigateway:*::/apis/*/routes/*/routeresponses\",\"arn:aws:apigateway:*::/apis/*/routes/*/routeresponses/*\",\"arn:aws:apigateway:*::/apis/*/stages\",\"arn:aws:apigateway:*::/apis/*/stages/*\",\"arn:aws:apigateway:*::/clientcertificates\",\"arn:aws:apigateway:*::/clientcertificates/*\",\"arn:aws:apigateway:*::/domainnames\",\"arn:aws:apigateway:*::/domainnames/*\",\"arn:aws:apigateway:*::/domainnames/*/apimappings\",\"arn:aws:apigateway:*::/domainnames/*/apimappings/*\",\"arn:aws:apigateway:*::/domainnames/*/basepathmappings\",\"arn:aws:apigateway:*::/domainnames/*/basepathmappings/*\",\"arn:aws:apigateway:*::/restapis\",\"arn:aws:apigateway:*::/restapis/*\",\"arn:aws:apigateway:*::/restapis/*/authorizers\",\"arn:aws:apigateway:*::/restapis/*/authorizers/*\",\"arn:aws:apigateway:*::/restapis/*/deployments\",\"arn:aws:apigateway:*::/restapis/*/deployments/*\",\"arn:aws:apigateway:*::/restapis/*/models\",\"arn:aws:apigateway:*::/restapis/*/models/*\",\"arn:aws:apigateway:*::/restapis/*/models/*/default_template\",\"arn:aws:apigateway:*::/restapis/*/resources\",\"arn:aws:apigateway:*::/restapis/*/resources/*\",\"arn:aws:apigateway:*::/restapis/*/resources/*/methods/*/integration/responses/*\",\"arn:aws:apigateway:*::/restapis/*/resources/*/methods/*/responses/*\",\"arn:aws:apigateway:*::/restapis/*/stages/*/sdks/*\",\"arn:aws:apigateway:*::/restapis/*/resources/*/methods/*\",\"arn:aws:apigateway:*::/restapis/*/resources/*/methods/*/integration\",\"arn:aws:apigateway:*::/restapis/*/stages\",\"arn:aws:apigateway:*::/restapis/*/stages/*\"]},{\"Action\":[\"iam:DeleteRole\"],\"Effect\":\"Allow\",\"Resource\":[\"arn:aws:iam::*:role/aws-service-role/support.amazonaws.com/AWSServiceRoleForSupport\"]},{\"Action\":[\"a4b:getDevice\",\"a4b:getProfile\",\"a4b:getRoom\",\"a4b:getRoomSkillParameter\",\"a4b:getSkillGroup\",\"a4b:searchDevices\",\"a4b:searchProfiles\",\"a4b:searchRooms\",\"a4b:searchSkillGroups\",\"access-analyzer:getFinding\",\"access-analyzer:listAnalyzers\",\"access-analyzer:listArchiveRules\",\"access-analyzer:listFindings\",\"acm-pca:describeCertificateAuthority\",\"acm-pca:describeCertificateAuthorityAuditReport\",\"acm-pca:getCertificate\",\"acm-pca:getCertificateAuthorityCertificate\",\"acm-pca:getCertificateAuthorityCsr\",\"acm-pca:listCertificateAuthorities\",\"acm-pca:listTags\",\"acm:describeCertificate\",\"acm:getCertificate\",\"acm:listCertificates\",\"acm:listTagsForCertificate\",\"airflow:getEnvironment\",\"airflow:listEnvironments\",\"airflow:listTagsForResource\",\"amplify:getApp\",\"amplify:getBranch\",\"amplify:getDomainAssociation\",\"amplify:getJob\",\"amplify:getWebhoo

and other than being huge, seems like a valid line

@krestivo-kdinfotech
Copy link
Author

This actually looks like a bug in Triplestore, linking wallix/triplestore#8

elkargig added a commit to elkargig/awless that referenced this issue Feb 9, 2022
Fixes `[error] file '~/.awless/aws/rdf/client-name/global/access.nt': bufio.Scanner: token too long`

Related: wallix#300
Related: wallix/triplestore#8
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

1 participant