ERA5-ROMS icon indicating copy to clipboard operation
ERA5-ROMS copied to clipboard

False is not of type string

Open crargr opened this issue 2 years ago • 6 comments

Hello @trondkr sorry for the bother.

I don't understand what is happening, I am setting

        self.start_year = 2017
        self.end_year = 2020
        self.project = "IEA"

with

        return {'IEA': '80/-40/45/15',
                'A20': '90/-180/40/180'}[project]

and I am getting the following:

2023-02-10 12:52:12,079 INFO Request is failed 2023-02-10 12:52:12,079 ERROR Message: the request you have submitted is not valid 2023-02-10 12:52:12,080 ERROR Reason: request['verbose'][0]: False is not of type 'string' 2023-02-10 12:52:12,080 ERROR Traceback (most recent call last): 2023-02-10 12:52:12,080 ERROR File "/opt/cdstoolbox/cdscompute/cdscompute/cdshandlers/services/handler.py", line 59, in handle_request 2023-02-10 12:52:12,080 ERROR result = cached(context.method, proc, context, context.args, context.kwargs) 2023-02-10 12:52:12,080 ERROR File "/opt/cdstoolbox/cdscompute/cdscompute/caching.py", line 108, in cached 2023-02-10 12:52:12,080 ERROR result = proc(context, *context.args, **context.kwargs) 2023-02-10 12:52:12,080 ERROR File "/opt/cdstoolbox/cdscompute/cdscompute/services.py", line 124, in call 2023-02-10 12:52:12,080 ERROR return p(*args, **kwargs) 2023-02-10 12:52:12,080 ERROR File "/opt/cdstoolbox/cdscompute/cdscompute/services.py", line 60, in call 2023-02-10 12:52:12,080 ERROR return self.proc(context, *args, **kwargs) 2023-02-10 12:52:12,080 ERROR File "/home/cds/cdsservices/services/mars/mars.py", line 48, in internal 2023-02-10 12:52:12,080 ERROR return mars(context, request, **kwargs) 2023-02-10 12:52:12,080 ERROR File "/home/cds/cdsservices/services/mars/mars.py", line 18, in mars 2023-02-10 12:52:12,080 ERROR **kwargs) 2023-02-10 12:52:12,080 ERROR File "/home/cds/cdsservices/services/mars/preprocess_request.py", line 24, in preprocess_request 2023-02-10 12:52:12,080 ERROR requests = enforce_minimal_schema(requests, context) 2023-02-10 12:52:12,080 ERROR File "/home/cds/cdsservices/services/mars/request_checking.py", line 54, in enforce_minimal_schema 2023-02-10 12:52:12,080 ERROR return enforce_schema(requests, schema, context) 2023-02-10 12:52:12,080 ERROR File "/opt/cdstoolbox/cds-common/cds_common/request_schemas/enforce_schema.py", line 29, in enforce_schema 2023-02-10 12:52:12,080 ERROR from None 2023-02-10 12:52:12,080 ERROR cdsinf.exceptions.BadRequestException: 2023-02-10 12:52:12,080 ERROR request['verbose'][0]: False is not of type 'string'

The funny thing is that this very same code was working very well last December. Any help and suggestion you could provide?

Thank you very much in advance.

crargr avatar Feb 10 '23 13:02 crargr

I’m not sure but if it worked two months ago it must be an issue w your packages. Try downgrading to previous version of CDS api and see if that helps. Perhaps a change in the api call not reflected in my code

Sent from Outlook for iOShttps://aka.ms/o0ukef


From: crargr @.> Sent: Friday, February 10, 2023 5:08:20 AM To: trondkr/ERA5-ROMS @.> Cc: Trond Kristiansen @.>; Mention @.> Subject: [trondkr/ERA5-ROMS] False is not of type string (Issue #10)

Hello @trondkrhttps://github.com/trondkr sorry for the bother.

I don't understand what is happening, I am setting

    self.start_year = 2017
    self.end_year = 2020
    self.project = "IEA"

with

    return {'IEA': '80/-40/45/15',
            'A20': '90/-180/40/180'}[project]

and I am getting the following:

2023-02-10 12:52:12,079 INFO Request is failed 2023-02-10 12:52:12,079 ERROR Message: the request you have submitted is not valid 2023-02-10 12:52:12,080 ERROR Reason: request['verbose'][0]: False is not of type 'string' 2023-02-10 12:52:12,080 ERROR Traceback (most recent call last): 2023-02-10 12:52:12,080 ERROR File "/opt/cdstoolbox/cdscompute/cdscompute/cdshandlers/services/handler.py", line 59, in handle_request 2023-02-10 12:52:12,080 ERROR result = cached(context.method, proc, context, context.args, context.kwargs) 2023-02-10 12:52:12,080 ERROR File "/opt/cdstoolbox/cdscompute/cdscompute/caching.py", line 108, in cached 2023-02-10 12:52:12,080 ERROR result = proc(context, *context.args, **context.kwargs) 2023-02-10 12:52:12,080 ERROR File "/opt/cdstoolbox/cdscompute/cdscompute/services.py", line 124, in call 2023-02-10 12:52:12,080 ERROR return p(*args, **kwargs) 2023-02-10 12:52:12,080 ERROR File "/opt/cdstoolbox/cdscompute/cdscompute/services.py", line 60, in call 2023-02-10 12:52:12,080 ERROR return self.proc(context, *args, **kwargs) 2023-02-10 12:52:12,080 ERROR File "/home/cds/cdsservices/services/mars/mars.py", line 48, in internal 2023-02-10 12:52:12,080 ERROR return mars(context, request, **kwargs) 2023-02-10 12:52:12,080 ERROR File "/home/cds/cdsservices/services/mars/mars.py", line 18, in mars 2023-02-10 12:52:12,080 ERROR **kwargs) 2023-02-10 12:52:12,080 ERROR File "/home/cds/cdsservices/services/mars/preprocess_request.py", line 24, in preprocess_request 2023-02-10 12:52:12,080 ERROR requests = enforce_minimal_schema(requests, context) 2023-02-10 12:52:12,080 ERROR File "/home/cds/cdsservices/services/mars/request_checking.py", line 54, in enforce_minimal_schema 2023-02-10 12:52:12,080 ERROR return enforce_schema(requests, schema, context) 2023-02-10 12:52:12,080 ERROR File "/opt/cdstoolbox/cds-common/cds_common/request_schemas/enforce_schema.py", line 29, in enforce_schema 2023-02-10 12:52:12,080 ERROR from None 2023-02-10 12:52:12,080 ERROR cdsinf.exceptions.BadRequestException: 2023-02-10 12:52:12,080 ERROR request['verbose'][0]: False is not of type 'string'

The funny thing is that this very same code was working very well last December. Any help and suggestion you could provide?

Thank you very much in advance.

— Reply to this email directly, view it on GitHubhttps://github.com/trondkr/ERA5-ROMS/issues/10, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AA32XAYIQVX6F3XAMMV3ZTDWWY4UJANCNFSM6AAAAAAUXY6SDE. You are receiving this because you were mentioned.Message ID: @.***>

trondkr avatar Feb 10 '23 14:02 trondkr

@trondkr thank you for your message. I will do as you say. Just to confirm, it still works for you, yes? All best, crargr

crargr avatar Feb 10 '23 14:02 crargr

I have not tested this in 6 months so not sure. My guess is they changed the call to an API which you need to change in ERA5-ROMS. Please submit a pull request for the fix if you find it.

Sent from Outlook for iOShttps://aka.ms/o0ukef


From: crargr @.> Sent: Friday, February 10, 2023 6:31:51 AM To: trondkr/ERA5-ROMS @.> Cc: Trond Kristiansen @.>; Mention @.> Subject: Re: [trondkr/ERA5-ROMS] False is not of type string (Issue #10)

@trondkrhttps://github.com/trondkr thank you for your message. I will do as you say. Just to confirm, it still works for you, yes? All best, crargr

— Reply to this email directly, view it on GitHubhttps://github.com/trondkr/ERA5-ROMS/issues/10#issuecomment-1425890228, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AA32XA2BJIYXCPBYB55H4Y3WWZGNPANCNFSM6AAAAAAUXY6SDE. You are receiving this because you were mentioned.Message ID: @.***>

trondkr avatar Feb 10 '23 14:02 trondkr

Dear @trondkr after messing a lot with the code, I found that commenting out

"verbose": self.config_ecmwf.debug from ECMWF_tools.py makes all work back to normal. Should I open a pull request? All best, crargr

crargr avatar Feb 10 '23 15:02 crargr

Sure that would be great

Sent from Outlook for iOShttps://aka.ms/o0ukef


From: crargr @.> Sent: Friday, February 10, 2023 7:19:40 AM To: trondkr/ERA5-ROMS @.> Cc: Trond Kristiansen @.>; Mention @.> Subject: Re: [trondkr/ERA5-ROMS] False is not of type string (Issue #10)

Dear @trondkrhttps://github.com/trondkr after messing a lot with the code, I found that commenting out

"verbose": self.config_ecmwf.debug from ECMWF_tools.py makes all work back to normal. Should I open a pull request? All best, crargr

— Reply to this email directly, view it on GitHubhttps://github.com/trondkr/ERA5-ROMS/issues/10#issuecomment-1425957584, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AA32XA5K2NRM7CYLUIPT6H3WWZMAZANCNFSM6AAAAAAUXY6SDE. You are receiving this because you were mentioned.Message ID: @.***>

trondkr avatar Feb 10 '23 15:02 trondkr

Hi @trondkr , I couldn't manage to do it. I attached here the file I changed. It was only a line but it might be caused by what you pointed out in your messages about the python versions. All best, crargr ECMWF_tools.zip

crargr avatar Feb 11 '23 12:02 crargr