wallix / awless

A Mighty CLI for AWS
http://awless.io/
Apache License 2.0
4.98k stars 263 forks source link

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

Open krestivo-kdinfotech opened 2 years ago

krestivo-kdinfotech commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

This actually looks like a bug in Triplestore, linking https://github.com/wallix/triplestore/issues/8